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

Unified Diff: pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart

Issue 2842213003: new TokenType and Keyword API (Closed)
Patch Set: rebase Created 3 years, 8 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/lib/src/services/completion/dart/keyword_contributor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart b/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
index ee485ffe846bc698b47a46636b981fa7a9045f88..96cf40ba938e2a2b55d50eba9896935fa58951a5 100644
--- a/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/dart/keyword_contributor.dart
@@ -182,11 +182,11 @@ class _KeywordVisitor extends GeneralizingAstVisitor {
!node.directives.any((d) => d is LibraryDirective)) {
_addSuggestions([Keyword.LIBRARY], DART_RELEVANCE_HIGH);
}
- _addSuggestion2('${Keyword.IMPORT.syntax} \'\';',
+ _addSuggestion2('${Keyword.IMPORT.lexeme} \'\';',
offset: 8, relevance: DART_RELEVANCE_HIGH);
- _addSuggestion2('${Keyword.EXPORT.syntax} \'\';',
+ _addSuggestion2('${Keyword.EXPORT.lexeme} \'\';',
offset: 8, relevance: DART_RELEVANCE_HIGH);
- _addSuggestion2('${Keyword.PART.syntax} \'\';',
+ _addSuggestion2('${Keyword.PART.lexeme} \'\';',
offset: 6, relevance: DART_RELEVANCE_HIGH);
}
if (entity == null || entity is Declaration) {
@@ -561,7 +561,7 @@ class _KeywordVisitor extends GeneralizingAstVisitor {
void _addSuggestion(Keyword keyword,
[int relevance = DART_RELEVANCE_KEYWORD]) {
- _addSuggestion2(keyword.syntax, relevance: relevance);
+ _addSuggestion2(keyword.lexeme, relevance: relevance);
}
void _addSuggestion2(String completion,

Powered by Google App Engine
This is Rietveld 408576698