| 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_services/completion/completion_computer.dart'; | 9 import 'package:analysis_services/completion/completion_computer.dart'; |
| 10 import 'package:analysis_services/completion/completion_suggestion.dart'; | 10 import 'package:analysis_services/completion/completion_suggestion.dart'; |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 void assertSuggestTopLevelVar(String completion, | 113 void assertSuggestTopLevelVar(String completion, |
| 114 [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) { | 114 [CompletionRelevance relevance = CompletionRelevance.DEFAULT]) { |
| 115 assertSuggest( | 115 assertSuggest( |
| 116 CompletionSuggestionKind.TOP_LEVEL_VARIABLE, | 116 CompletionSuggestionKind.TOP_LEVEL_VARIABLE, |
| 117 completion, | 117 completion, |
| 118 relevance); | 118 relevance); |
| 119 } | 119 } |
| 120 | 120 |
| 121 void assertSuggestVariable(String completion, [CompletionRelevance relevance = | 121 void assertSuggestVariable(String completion, [CompletionRelevance relevance = |
| 122 CompletionRelevance.DEFAULT]) { | 122 CompletionRelevance.DEFAULT]) { |
| 123 assertSuggest(CompletionSuggestionKind.VARIABLE, completion, relevance); | 123 assertSuggest(CompletionSuggestionKind.LOCAL_VARIABLE, completion, relevance
); |
| 124 } | 124 } |
| 125 | 125 |
| 126 bool computeFast() { | 126 bool computeFast() { |
| 127 _computeFastCalled = true; | 127 _computeFastCalled = true; |
| 128 computer | 128 computer |
| 129 ..context = context | 129 ..context = context |
| 130 ..searchEngine = searchEngine | 130 ..searchEngine = searchEngine |
| 131 ..source = testSource | 131 ..source = testSource |
| 132 ..offset = completionOffset; | 132 ..offset = completionOffset; |
| 133 suggestions = []; | 133 suggestions = []; |
| (...skipping 23 matching lines...) Expand all Loading... |
| 157 } | 157 } |
| 158 | 158 |
| 159 @override | 159 @override |
| 160 void setUp() { | 160 void setUp() { |
| 161 super.setUp(); | 161 super.setUp(); |
| 162 index = createLocalMemoryIndex(); | 162 index = createLocalMemoryIndex(); |
| 163 searchEngine = new SearchEngineImpl(index); | 163 searchEngine = new SearchEngineImpl(index); |
| 164 addResolvedUnit(MockSdk.LIB_CORE.path, MockSdk.LIB_CORE.content); | 164 addResolvedUnit(MockSdk.LIB_CORE.path, MockSdk.LIB_CORE.content); |
| 165 } | 165 } |
| 166 } | 166 } |
| OLD | NEW |