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

Unified Diff: pkg/analyzer/lib/src/dart/ast/utilities.dart

Issue 2936143002: update statement completion for fasta scanner (Closed)
Patch Set: address comments Created 3 years, 6 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 | « pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/src/dart/ast/utilities.dart
diff --git a/pkg/analyzer/lib/src/dart/ast/utilities.dart b/pkg/analyzer/lib/src/dart/ast/utilities.dart
index dc303a376d86f22bb5af790a49558326be638be6..ccb388e64c02c03fe1b9925bdbfb846dc2eea667 100644
--- a/pkg/analyzer/lib/src/dart/ast/utilities.dart
+++ b/pkg/analyzer/lib/src/dart/ast/utilities.dart
@@ -3977,7 +3977,10 @@ class NodeLocator extends UnifyingAstVisitor<Object> {
Token endToken = node.endToken;
// Don't include synthetic tokens.
while (endToken != beginToken) {
- if (endToken.type == TokenType.EOF || !endToken.isSynthetic) {
+ // Fasta scanner reports unterminated string literal errors
+ // and generates a synthetic string token with non-zero length.
+ // Because of this, check for length > 0 rather than !isSynthetic.
+ if (endToken.type == TokenType.EOF || endToken.length > 0) {
break;
}
endToken = endToken.previous;
« no previous file with comments | « pkg/analysis_server/lib/src/services/completion/statement/statement_completion.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698