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