OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library test.services.completion.dart.util; | 5 library test.services.completion.dart.util; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol | 9 import 'package:analysis_server/plugin/protocol/protocol.dart' as protocol |
10 show Element, ElementKind; | 10 show Element, ElementKind; |
(...skipping 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 // Future.value or Future() constructors use scheduleMicrotask themselves an
d | 447 // Future.value or Future() constructors use scheduleMicrotask themselves an
d |
448 // would therefore not wait for microtask callbacks that are scheduled after | 448 // would therefore not wait for microtask callbacks that are scheduled after |
449 // invoking this method. | 449 // invoking this method. |
450 return new Future.delayed( | 450 return new Future.delayed( |
451 Duration.ZERO, () => computeLibrariesContaining(times - 1)); | 451 Duration.ZERO, () => computeLibrariesContaining(times - 1)); |
452 } | 452 } |
453 | 453 |
454 Future computeSuggestions([int times = 200]) async { | 454 Future computeSuggestions([int times = 200]) async { |
455 context.analysisPriorityOrder = [testSource]; | 455 context.analysisPriorityOrder = [testSource]; |
456 CompletionRequestImpl baseRequest = new CompletionRequestImpl( | 456 CompletionRequestImpl baseRequest = new CompletionRequestImpl( |
| 457 null, |
457 context, | 458 context, |
458 provider, | 459 provider, |
459 searchEngine, | 460 searchEngine, |
460 testSource, | 461 testSource, |
461 completionOffset, | 462 completionOffset, |
462 new CompletionPerformance()); | 463 new CompletionPerformance()); |
463 | 464 |
464 // Build the request | 465 // Build the request |
465 Completer<DartCompletionRequest> requestCompleter = | 466 Completer<DartCompletionRequest> requestCompleter = |
466 new Completer<DartCompletionRequest>(); | 467 new Completer<DartCompletionRequest>(); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
559 } | 560 } |
560 | 561 |
561 @override | 562 @override |
562 void setUp() { | 563 void setUp() { |
563 super.setUp(); | 564 super.setUp(); |
564 index = createMemoryIndex(); | 565 index = createMemoryIndex(); |
565 searchEngine = new SearchEngineImpl(index); | 566 searchEngine = new SearchEngineImpl(index); |
566 contributor = createContributor(); | 567 contributor = createContributor(); |
567 } | 568 } |
568 } | 569 } |
OLD | NEW |