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

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

Issue 1851623002: Issue 26148. Don't use a current token if it does not match - create a new synthetic. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 807a02eb433de87730d56be106f4f38945bae1e5..2867bebee48ea9e6ed91eeb1eff999a18259815a 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
@@ -81,7 +81,8 @@ class _KeywordVisitor extends GeneralizingAstVisitor {
if (next.isSynthetic) {
next = next.next;
}
- if (previous.lexeme == ')' && next.lexeme == '{') {
+ if (previous.type == TokenType.CLOSE_PAREN &&
+ next.type == TokenType.OPEN_CURLY_BRACKET) {
_addSuggestion2(ASYNC);
_addSuggestion2(ASYNC_STAR);
_addSuggestion2(SYNC_STAR);
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/parser.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698