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

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

Issue 1084233003: suggest this keyword in constructor param list (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge Created 5 years, 8 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 a202fba4da25145b2ba987049e40f385a5c66bd5..c38a01f647546cd978026b9d8b93bdad0fd28591 100644
--- a/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
+++ b/pkg/analysis_server/lib/src/services/completion/keyword_contributor.dart
@@ -118,6 +118,15 @@ class _KeywordVisitor extends GeneralizingAstVisitor {
}
@override
+ visitFormalParameterList(FormalParameterList node) {
+ AstNode constructorDecl =
+ node.getAncestor((p) => p is ConstructorDeclaration);
+ if (constructorDecl != null) {
+ _addSuggestions([Keyword.THIS]);
+ }
+ }
+
+ @override
visitIfStatement(IfStatement node) {
if (entity == node.thenStatement) {
_addStatementKeywords(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