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

Unified Diff: pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.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
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.dart
diff --git a/pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.dart b/pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.dart
index 6274b4a451fe2f7427c8ba1821b7780f7f1d0f45..8159c1ccf8b8f0857f0bc82a321d84ee0de02776 100644
--- a/pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.dart
+++ b/pkg/analysis_server/lib/src/provisional/completion/dart/completion_target.dart
@@ -389,8 +389,7 @@ class CompletionTarget {
// If the node's first token is a keyword or identifier, then the node is a
// candidate entity if its first token is.
Token beginToken = node.beginToken;
- if (beginToken.type == TokenType.KEYWORD ||
- beginToken.type == TokenType.IDENTIFIER) {
+ if (beginToken.type.isKeyword || beginToken.type == TokenType.IDENTIFIER) {
return _isCandidateToken(beginToken, offset);
}
@@ -413,7 +412,7 @@ class CompletionTarget {
if (offset < token.end) {
return true;
} else if (offset == token.end) {
- return token.type == TokenType.KEYWORD ||
+ return token.type.isKeyword ||
token.type == TokenType.IDENTIFIER ||
token.length == 0;
} else if (!token.isSynthetic) {
@@ -425,8 +424,7 @@ class CompletionTarget {
if (offset < previous.end) {
return true;
} else if (offset == previous.end) {
- return token.type == TokenType.KEYWORD ||
- previous.type == TokenType.IDENTIFIER;
+ return token.type.isKeyword || previous.type == TokenType.IDENTIFIER;
} else {
return false;
}
« no previous file with comments | « no previous file | pkg/analysis_server/lib/src/services/completion/dart/completion_manager.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698