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

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

Issue 460333003: do not suggest types when editing a name in a variable declaration (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after
171 if (param.identifier != null) { 171 if (param.identifier != null) {
172 addSuggestion(param.identifier, CompletionSuggestionKind.PARAMETER); 172 addSuggestion(param.identifier, CompletionSuggestionKind.PARAMETER);
173 } 173 }
174 }); 174 });
175 visitNode(node); 175 visitNode(node);
176 } 176 }
177 177
178 visitNode(AstNode node) { 178 visitNode(AstNode node) {
179 node.parent.accept(this); 179 node.parent.accept(this);
180 } 180 }
181
182 visitVariableDeclaration(VariableDeclaration node) {
183 // Do not add suggestions if editing the name in a var declaration
184 SimpleIdentifier name = node.name;
185 if (name == null || name.offset < offset || offset > name.end) {
186 visitNode(node);
187 }
188 }
181 } 189 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698