Index: pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart |
diff --git a/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart b/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart |
index ce253e9996db415516125459a08d5d022a3e2ae1..699a5cd6ed47ca95af97a957aa45e4da8fd24081 100644 |
--- a/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart |
+++ b/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart |
@@ -145,26 +145,16 @@ class _KeywordVisitor extends GeneralizingAstVisitor { |
} |
@override |
- visitExpression(Expression node) { |
- _addExpressionKeywords(node); |
- } |
- |
- @override |
- visitInstanceCreationExpression(InstanceCreationExpression node) { |
- if (entity == node.constructorName) { |
- // no keywords in 'new ^' expression |
- } else { |
- super.visitInstanceCreationExpression(node); |
+ visitPropertyAccess(PropertyAccess node) { |
+ // suggestions before '.' but not after |
+ if (entity != node.propertyName) { |
+ super.visitPropertyAccess(node); |
} |
} |
@override |
- visitMethodInvocation(MethodInvocation node) { |
- if (entity == node.methodName) { |
- // no keywords in '.' expression |
- } else { |
- super.visitMethodInvocation(node); |
- } |
+ visitExpression(Expression node) { |
+ _addExpressionKeywords(node); |
} |
@override |
@@ -217,6 +207,20 @@ class _KeywordVisitor extends GeneralizingAstVisitor { |
} |
@override |
+ visitInstanceCreationExpression(InstanceCreationExpression node) { |
+ if (entity == node.constructorName) { |
+ // no keywords in 'new ^' expression |
+ } else { |
+ super.visitInstanceCreationExpression(node); |
+ } |
+ } |
+ |
+ @override |
+ visitLibraryIdentifier(LibraryIdentifier node) { |
+ // no suggestions |
+ } |
+ |
+ @override |
visitMethodDeclaration(MethodDeclaration node) { |
if (entity == node.body) { |
if (node.body is EmptyFunctionBody) { |
@@ -229,6 +233,15 @@ class _KeywordVisitor extends GeneralizingAstVisitor { |
} |
@override |
+ visitMethodInvocation(MethodInvocation node) { |
+ if (entity == node.methodName) { |
+ // no keywords in '.' expression |
+ } else { |
+ super.visitMethodInvocation(node); |
+ } |
+ } |
+ |
+ @override |
visitNamedExpression(NamedExpression node) { |
if (entity is SimpleIdentifier && entity == node.expression) { |
_addExpressionKeywords(node); |