| 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 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 429 context.performAnalysisTask(); | 429 context.performAnalysisTask(); |
| 430 // We use a delayed future to allow microtask events to finish. The | 430 // We use a delayed future to allow microtask events to finish. The |
| 431 // Future.value or Future() constructors use scheduleMicrotask themselves an
d | 431 // Future.value or Future() constructors use scheduleMicrotask themselves an
d |
| 432 // would therefore not wait for microtask callbacks that are scheduled after | 432 // would therefore not wait for microtask callbacks that are scheduled after |
| 433 // invoking this method. | 433 // invoking this method. |
| 434 return new Future.delayed( | 434 return new Future.delayed( |
| 435 Duration.ZERO, () => computeLibrariesContaining(times - 1)); | 435 Duration.ZERO, () => computeLibrariesContaining(times - 1)); |
| 436 } | 436 } |
| 437 | 437 |
| 438 Future computeSuggestions([int times = 200]) async { | 438 Future computeSuggestions([int times = 200]) async { |
| 439 context.analysisPriorityOrder = [testSource]; |
| 439 CompletionRequestImpl baseRequest = new CompletionRequestImpl( | 440 CompletionRequestImpl baseRequest = new CompletionRequestImpl( |
| 440 context, | 441 context, |
| 441 provider, | 442 provider, |
| 442 searchEngine, | 443 searchEngine, |
| 443 testSource, | 444 testSource, |
| 444 completionOffset, | 445 completionOffset, |
| 445 new CompletionPerformance()); | 446 new CompletionPerformance()); |
| 446 | 447 |
| 447 // Build the request | 448 // Build the request |
| 448 Completer<DartCompletionRequest> requestCompleter = | 449 Completer<DartCompletionRequest> requestCompleter = |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 538 } | 539 } |
| 539 | 540 |
| 540 @override | 541 @override |
| 541 void setUp() { | 542 void setUp() { |
| 542 super.setUp(); | 543 super.setUp(); |
| 543 index = createLocalMemoryIndex(); | 544 index = createLocalMemoryIndex(); |
| 544 searchEngine = new SearchEngineImpl(index); | 545 searchEngine = new SearchEngineImpl(index); |
| 545 contributor = createContributor(); | 546 contributor = createContributor(); |
| 546 } | 547 } |
| 547 } | 548 } |
| OLD | NEW |