| Index: pkg/analysis_server/lib/src/services/completion/completion_target.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/completion_target.dart b/pkg/analysis_server/lib/src/services/completion/completion_target.dart
|
| index 7c7badc5759bd32a6437f6cc058a7919cbd2ea26..a1f315bbab97740897ac0b2176ad04ae8b499786 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/completion_target.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/completion_target.dart
|
| @@ -320,6 +320,17 @@ class CompletionTarget {
|
| return token.type == TokenType.KEYWORD ||
|
| token.type == TokenType.IDENTIFIER ||
|
| token.length == 0;
|
| + } else if (!token.isSynthetic) {
|
| + return false;
|
| + }
|
| + // If the current token is synthetic, then check the previous token
|
| + // because it may have been dropped from the parse tree
|
| + Token previous = token.previous;
|
| + if (offset < previous.end) {
|
| + return true;
|
| + } else if (offset == previous.end) {
|
| + return token.type == TokenType.KEYWORD ||
|
| + previous.type == TokenType.IDENTIFIER;
|
| } else {
|
| return false;
|
| }
|
|
|