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

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

Issue 802163002: include local functions in completion suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 6 years 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/completion_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/local_declaration_visitor.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart b/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart
index 09ed9e39319a53b02dd49f4ade9f718dde9280a2..ccdd8ba658fd7200732f5d069d8748d49aef498e 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_declaration_visitor.dart
@@ -62,6 +62,17 @@ abstract class LocalDeclarationVisitor extends GeneralizingAstVisitor<bool> {
}
});
}
+ } else if (stmt is FunctionDeclarationStatement) {
+ FunctionDeclaration declaration = stmt.functionDeclaration;
+ if (declaration != null && declaration.offset < offset) {
+ SimpleIdentifier id = declaration.name;
+ if (id != null) {
+ String name = id.name;
+ if (name != null && name.length > 0) {
+ declaredFunction(declaration);
+ }
+ }
+ }
}
}
});
« no previous file with comments | « no previous file | pkg/analysis_server/test/completion_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698