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

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

Issue 637703002: add suggestions for variable declaration assignment RHS (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years, 2 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/completion_test_util.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/imported_computer.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
index b159ea8053664ff5daadc86985a2a50588f9c117..c032211ab62bd59f0d1e03df5a2fcaadc1386760 100644
--- a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
@@ -14,6 +14,7 @@ import 'package:analysis_server/src/services/search/search_engine.dart';
import 'package:analyzer/src/generated/ast.dart';
import 'package:analyzer/src/generated/element.dart';
import 'package:analyzer/src/generated/resolver.dart';
+import 'package:analyzer/src/generated/scanner.dart';
import 'package:analyzer/src/generated/source.dart';
/**
@@ -103,6 +104,16 @@ class _ImportedVisitor extends GeneralizingAstVisitor<Future<bool>> {
return _addImportedElementSuggestions(typesOnly: true);
}
+ @override
+ visitVariableDeclaration(VariableDeclaration node) {
+ Token equals = node.equals;
+ // Make suggestions for the RHS of a variable declaration
+ if (equals != null && request.offset >= equals.end) {
+ return _addImportedElementSuggestions();
+ }
+ return new Future.value(false);
+ }
+
Future _addCombinatorSuggestions(Combinator node) {
var directive = node.getAncestor((parent) => parent is NamespaceDirective);
if (directive is NamespaceDirective) {
« no previous file with comments | « no previous file | pkg/analysis_server/test/services/completion/completion_test_util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698