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.util; | 5 library test.services.completion.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 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 assertSuggestGetter(name, returnType); | 434 assertSuggestGetter(name, returnType); |
435 assertSuggestSetter(name); | 435 assertSuggestSetter(name); |
436 } else { | 436 } else { |
437 assertNotSuggested(name); | 437 assertNotSuggested(name); |
438 } | 438 } |
439 } | 439 } |
440 | 440 |
441 bool computeFast() { | 441 bool computeFast() { |
442 expect(computeFastResult, isNull); | 442 expect(computeFastResult, isNull); |
443 _completionManager = new DartCompletionManager(context, searchEngine, | 443 _completionManager = new DartCompletionManager(context, searchEngine, |
444 testSource, cache, [contributor], new CommonUsageSorter({})); | 444 testSource, cache, [contributor], [], new CommonUsageSorter({})); |
445 var result = | 445 var result = |
446 _completionManager.computeFast(request, new CompletionPerformance()); | 446 _completionManager.computeFast(request, new CompletionPerformance()); |
447 expect(request.replacementOffset, isNotNull); | 447 expect(request.replacementOffset, isNotNull); |
448 expect(request.replacementLength, isNotNull); | 448 expect(request.replacementLength, isNotNull); |
449 computeFastResult = result.isEmpty; | 449 computeFastResult = result.isEmpty; |
450 return computeFastResult; | 450 return computeFastResult; |
451 } | 451 } |
452 | 452 |
453 Future computeFull(assertFunction(bool result), {bool fullAnalysis: true}) { | 453 Future computeFull(assertFunction(bool result), {bool fullAnalysis: true}) { |
454 if (computeFastResult == null) { | 454 if (computeFastResult == null) { |
(...skipping 4265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4720 assertNotSuggested('bar2'); | 4720 assertNotSuggested('bar2'); |
4721 assertNotSuggested('_B'); | 4721 assertNotSuggested('_B'); |
4722 assertSuggestLocalClass('Y'); | 4722 assertSuggestLocalClass('Y'); |
4723 assertSuggestLocalClass('C'); | 4723 assertSuggestLocalClass('C'); |
4724 assertSuggestLocalVariable('f', null); | 4724 assertSuggestLocalVariable('f', null); |
4725 assertNotSuggested('x'); | 4725 assertNotSuggested('x'); |
4726 assertNotSuggested('e'); | 4726 assertNotSuggested('e'); |
4727 }); | 4727 }); |
4728 } | 4728 } |
4729 } | 4729 } |
OLD | NEW |