| 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |