Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(435)

Unified Diff: pkg/analysis_server/test/services/completion/completion_test_util.dart

Issue 1157113004: add enum suggestions (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/test/services/completion/completion_test_util.dart
diff --git a/pkg/analysis_server/test/services/completion/completion_test_util.dart b/pkg/analysis_server/test/services/completion/completion_test_util.dart
index 6e76a4e444902b36b1d3edf9dc354c4f3a20c211..83ca4e57107a4edbd0f9f4a17d1ee5f17560f0f8 100644
--- a/pkg/analysis_server/test/services/completion/completion_test_util.dart
+++ b/pkg/analysis_server/test/services/completion/completion_test_util.dart
@@ -65,7 +65,8 @@ abstract class AbstractCompletionTest extends AbstractContextTest {
content.substring(completionOffset + 1);
testSource = addSource(testFile, content);
cache = new DartCompletionCache(context, testSource);
- AnalysisServer server = new AnalysisServerMock(searchEngine: searchEngine, resourceProvider: provider);
+ AnalysisServer server = new AnalysisServerMock(
+ searchEngine: searchEngine, resourceProvider: provider);
request = new DartCompletionRequest(
server, context, testSource, completionOffset, cache);
}
@@ -552,6 +553,26 @@ abstract class AbstractSelectorSuggestionTest extends AbstractCompletionTest {
// Subclasses override
}
+ CompletionSuggestion assertSuggestEnum(String completion,
+ {bool isDeprecated: false}) {
+ CompletionSuggestion suggestion =
+ assertSuggest(completion, isDeprecated: isDeprecated);
+ expect(suggestion.isDeprecated, isDeprecated);
+ expect(suggestion.element.kind, protocol.ElementKind.ENUM);
+ return suggestion;
+ }
+
+ CompletionSuggestion assertSuggestEnumConst(String completion,
+ {bool isDeprecated: false}) {
+ CompletionSuggestion suggestion =
+ assertSuggest(completion, isDeprecated: isDeprecated);
+ expect(suggestion.isDeprecated, isDeprecated);
+ // TODO(danrubel) : Perhaps should be protocol.ElementKind.ENUM_CONST
+ // but element model represents them as FIELD
+ expect(suggestion.element.kind, protocol.ElementKind.FIELD);
+ return suggestion;
+ }
+
CompletionSuggestion assertSuggestImportedClass(String name,
{CompletionSuggestionKind kind: CompletionSuggestionKind.INVOCATION,
int relevance: DART_RELEVANCE_DEFAULT, String importUri}) {

Powered by Google App Engine
This is Rietveld 408576698