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

Unified Diff: pkg/analysis_services/lib/src/completion/local_computer.dart

Issue 460333003: do not suggest types when editing a name in a variable declaration (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 4 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
Index: pkg/analysis_services/lib/src/completion/local_computer.dart
diff --git a/pkg/analysis_services/lib/src/completion/local_computer.dart b/pkg/analysis_services/lib/src/completion/local_computer.dart
index a9cd972fefa7da150e2098db60a97ed1a373932f..143c9a0dbcf270775d1dcd167ebd20a97eb516ef 100644
--- a/pkg/analysis_services/lib/src/completion/local_computer.dart
+++ b/pkg/analysis_services/lib/src/completion/local_computer.dart
@@ -178,4 +178,12 @@ class _LocalVisitor extends GeneralizingAstVisitor<dynamic> {
visitNode(AstNode node) {
node.parent.accept(this);
}
+
+ visitVariableDeclaration(VariableDeclaration node) {
+ // Do not add suggestions if editing the name in a var declaration
+ SimpleIdentifier name = node.name;
+ if (name == null || name.offset < offset || offset > name.end) {
+ visitNode(node);
+ }
+ }
}

Powered by Google App Engine
This is Rietveld 408576698