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

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

Issue 1151493004: no keyword suggestions in library identifier or property accessor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge Created 5 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 | « no previous file | pkg/analysis_server/test/services/completion/keyword_contributor_test.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/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);
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/keyword_contributor_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698