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

Side by Side Diff: pkg/analysis_services/lib/src/completion/local_computer.dart

Issue 459743002: local code completion computer improvements (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | pkg/analysis_services/test/completion/local_computer_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library services.completion.computer.dart.local; 5 library services.completion.computer.dart.local;
6 6
7 import 'dart:async'; 7 import 'dart:async';
8 8
9 import 'package:analysis_services/completion/completion_computer.dart'; 9 import 'package:analysis_services/completion/completion_computer.dart';
10 import 'package:analysis_services/completion/completion_suggestion.dart'; 10 import 'package:analysis_services/completion/completion_suggestion.dart';
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 79
80 visitBlock(Block node) { 80 visitBlock(Block node) {
81 node.statements.forEach((Statement stmt) { 81 node.statements.forEach((Statement stmt) {
82 if (stmt.offset < offset) { 82 if (stmt.offset < offset) {
83 if (stmt is LabeledStatement) { 83 if (stmt is LabeledStatement) {
84 stmt.labels.forEach((Label label) { 84 stmt.labels.forEach((Label label) {
85 // addSuggestion(label.label, CompletionSuggestionKind.LABEL); 85 // addSuggestion(label.label, CompletionSuggestionKind.LABEL);
86 }); 86 });
87 } else if (stmt is VariableDeclarationStatement) { 87 } else if (stmt is VariableDeclarationStatement) {
88 addSuggestions(stmt.variables, CompletionSuggestionKind.VARIABLE); 88 stmt.variables.variables.forEach((VariableDeclaration varDecl) {
89 if (varDecl.end < offset) {
90 addSuggestion(varDecl.name, CompletionSuggestionKind.VARIABLE);
91 }
92 });
89 } 93 }
90 } 94 }
91 }); 95 });
92 visitNode(node); 96 visitNode(node);
93 } 97 }
94 98
95 visitCatchClause(CatchClause node) { 99 visitCatchClause(CatchClause node) {
96 addSuggestion(node.exceptionParameter, CompletionSuggestionKind.PARAMETER); 100 addSuggestion(node.exceptionParameter, CompletionSuggestionKind.PARAMETER);
97 addSuggestion(node.stackTraceParameter, CompletionSuggestionKind.PARAMETER); 101 addSuggestion(node.stackTraceParameter, CompletionSuggestionKind.PARAMETER);
98 visitNode(node); 102 visitNode(node);
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 addSuggestion(param.identifier, CompletionSuggestionKind.PARAMETER); 170 addSuggestion(param.identifier, CompletionSuggestionKind.PARAMETER);
167 } 171 }
168 }); 172 });
169 visitNode(node); 173 visitNode(node);
170 } 174 }
171 175
172 visitNode(AstNode node) { 176 visitNode(AstNode node) {
173 node.parent.accept(this); 177 node.parent.accept(this);
174 } 178 }
175 } 179 }
OLDNEW
« no previous file with comments | « no previous file | pkg/analysis_services/test/completion/local_computer_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698