| OLD | NEW |
| 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 Loading... |
| 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 } |
| OLD | NEW |