| 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.domain.completion; | 5 library test.domain.completion; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/analysis_server.dart'; | 9 import 'package:analysis_server/src/analysis_server.dart'; |
| 10 import 'package:analysis_server/src/channel/channel.dart'; | 10 import 'package:analysis_server/src/channel/channel.dart'; |
| (...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 | 415 |
| 416 test_topLevel() { | 416 test_topLevel() { |
| 417 addTestFile(''' | 417 addTestFile(''' |
| 418 typedef foo(); | 418 typedef foo(); |
| 419 var test = ''; | 419 var test = ''; |
| 420 main() {tes^t} | 420 main() {tes^t} |
| 421 '''); | 421 '''); |
| 422 return getSuggestions().then((_) { | 422 return getSuggestions().then((_) { |
| 423 expect(replacementOffset, equals(completionOffset - 3)); | 423 expect(replacementOffset, equals(completionOffset - 3)); |
| 424 expect(replacementLength, equals(4)); | 424 expect(replacementLength, equals(4)); |
| 425 assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object'); | 425 // Suggestions based upon imported results are partially filtered |
| 426 //assertHasResult(CompletionSuggestionKind.INVOCATION, 'Object'); |
| 426 assertHasResult(CompletionSuggestionKind.INVOCATION, 'test'); | 427 assertHasResult(CompletionSuggestionKind.INVOCATION, 'test'); |
| 427 assertNoResult('HtmlElement'); | 428 assertNoResult('HtmlElement'); |
| 428 }); | 429 }); |
| 429 } | 430 } |
| 430 } | 431 } |
| 431 | 432 |
| 432 class MockCache extends CompletionCache { | 433 class MockCache extends CompletionCache { |
| 433 MockCache(AnalysisContext context, Source source) : super(context, source); | 434 MockCache(AnalysisContext context, Source source) : super(context, source); |
| 434 } | 435 } |
| 435 | 436 |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 557 | 558 |
| 558 void contextsChangedRaw(ContextsChangedEvent newEvent) { | 559 void contextsChangedRaw(ContextsChangedEvent newEvent) { |
| 559 super.contextsChanged(newEvent); | 560 super.contextsChanged(newEvent); |
| 560 } | 561 } |
| 561 | 562 |
| 562 CompletionManager createCompletionManager(AnalysisContext context, | 563 CompletionManager createCompletionManager(AnalysisContext context, |
| 563 Source source, SearchEngine searchEngine) { | 564 Source source, SearchEngine searchEngine) { |
| 564 return new MockCompletionManager(mockContext, source, searchEngine); | 565 return new MockCompletionManager(mockContext, source, searchEngine); |
| 565 } | 566 } |
| 566 } | 567 } |
| OLD | NEW |