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

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

Issue 967643002: throw exception to stop visiting (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 10 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_server/lib/src/services/completion/local_computer.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/local_computer.dart b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
index 4a7584f231cdb780f771b613d2a57ada415602c0..d2125335de5e5c78060c518af12dffec8471821d 100644
--- a/pkg/analysis_server/lib/src/services/completion/local_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/local_computer.dart
@@ -34,7 +34,7 @@ class LocalComputer extends DartCompletionComputer {
// Collect suggestions from the specific child [AstNode] that contains
// the completion offset and all of its parents recursively.
- request.node.accept(localVisitor);
+ localVisitor.visit(request.node);
}
if (optype.includeStatementLabelSuggestions ||
optype.includeCaseLabelSuggestions) {
@@ -42,7 +42,7 @@ class LocalComputer extends DartCompletionComputer {
request,
optype.includeStatementLabelSuggestions,
optype.includeCaseLabelSuggestions);
- request.node.accept(labelVisitor);
+ labelVisitor.visit(request.node);
}
// If the unit is not a part and does not reference any parts
@@ -139,19 +139,17 @@ class _LabelVisitor extends LocalDeclarationVisitor {
}
@override
- bool visitFunctionExpression(FunctionExpression node) {
+ void visitFunctionExpression(FunctionExpression node) {
// Labels are only accessible within the local function, so stop visiting
// once we reach a function boundary.
- finished = true;
- return true;
+ finished();
}
@override
- bool visitMethodDeclaration(MethodDeclaration node) {
+ void visitMethodDeclaration(MethodDeclaration node) {
// Labels are only accessible within the local function, so stop visiting
// once we reach a function boundary.
- finished = true;
- return true;
+ finished();
}
CompletionSuggestion _addSuggestion(SimpleIdentifier id) {

Powered by Google App Engine
This is Rietveld 408576698