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

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

Issue 459853003: remove duplicate suggestions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: fix suggestion notification processing in test 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
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 addSuggestion(node.identifier, CompletionSuggestionKind.VARIABLE); 146 addSuggestion(node.identifier, CompletionSuggestionKind.VARIABLE);
147 visitNode(node); 147 visitNode(node);
148 } 148 }
149 149
150 visitForStatement(ForStatement node) { 150 visitForStatement(ForStatement node) {
151 addSuggestions(node.variables, CompletionSuggestionKind.VARIABLE); 151 addSuggestions(node.variables, CompletionSuggestionKind.VARIABLE);
152 visitNode(node); 152 visitNode(node);
153 } 153 }
154 154
155 visitFunctionDeclaration(FunctionDeclaration node) { 155 visitFunctionDeclaration(FunctionDeclaration node) {
156 addSuggestion(node.name, CompletionSuggestionKind.FUNCTION); 156 // This is added by the compilation unit containing it
157 //addSuggestion(node.name, CompletionSuggestionKind.FUNCTION);
157 visitNode(node); 158 visitNode(node);
158 } 159 }
159 160
160 visitFunctionExpression(FunctionExpression node) { 161 visitFunctionExpression(FunctionExpression node) {
161 node.parameters.parameters.forEach((FormalParameter param) { 162 node.parameters.parameters.forEach((FormalParameter param) {
162 addSuggestion(param.identifier, CompletionSuggestionKind.PARAMETER); 163 addSuggestion(param.identifier, CompletionSuggestionKind.PARAMETER);
163 }); 164 });
164 visitNode(node); 165 visitNode(node);
165 } 166 }
166 167
167 visitMethodDeclaration(MethodDeclaration node) { 168 visitMethodDeclaration(MethodDeclaration node) {
168 node.parameters.parameters.forEach((FormalParameter param) { 169 node.parameters.parameters.forEach((FormalParameter param) {
169 if (param.identifier != null) { 170 if (param.identifier != null) {
170 addSuggestion(param.identifier, CompletionSuggestionKind.PARAMETER); 171 addSuggestion(param.identifier, CompletionSuggestionKind.PARAMETER);
171 } 172 }
172 }); 173 });
173 visitNode(node); 174 visitNode(node);
174 } 175 }
175 176
176 visitNode(AstNode node) { 177 visitNode(AstNode node) {
177 node.parent.accept(this); 178 node.parent.accept(this);
178 } 179 }
179 } 180 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/test/domain_completion_test.dart ('k') | pkg/analysis_services/test/completion/completion_test_util.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698