| 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_server/src/protocol.dart' as protocol show Element, | 9 import 'package:analysis_server/src/protocol.dart' as protocol show Element, |
| 10 ElementKind; | 10 ElementKind; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 _addFunctionSuggestion(declaration); | 132 _addFunctionSuggestion(declaration); |
| 133 } else if (declaration is TopLevelVariableDeclaration) { | 133 } else if (declaration is TopLevelVariableDeclaration) { |
| 134 _addTopLevelVarSuggestions(declaration.variables); | 134 _addTopLevelVarSuggestions(declaration.variables); |
| 135 } else if (declaration is ClassTypeAlias) { | 135 } else if (declaration is ClassTypeAlias) { |
| 136 _addSuggestion( | 136 _addSuggestion( |
| 137 declaration.name, | 137 declaration.name, |
| 138 CompletionSuggestionKind.CLASS_ALIAS, | 138 CompletionSuggestionKind.CLASS_ALIAS, |
| 139 null, | 139 null, |
| 140 null); | 140 null); |
| 141 } else if (declaration is FunctionTypeAlias) { | 141 } else if (declaration is FunctionTypeAlias) { |
| 142 _addSuggestion( | 142 CompletionSuggestion suggestion = _addSuggestion( |
| 143 declaration.name, | 143 declaration.name, |
| 144 CompletionSuggestionKind.FUNCTION_TYPE_ALIAS, | 144 CompletionSuggestionKind.FUNCTION_TYPE_ALIAS, |
| 145 declaration.returnType, | 145 declaration.returnType, |
| 146 null); | 146 null); |
| 147 if (suggestion != null) { |
| 148 suggestion.element = _createElement( |
| 149 protocol.ElementKind.FUNCTION_TYPE_ALIAS, |
| 150 declaration.name, |
| 151 null, // TODO (danrubel) determine parameters |
| 152 NO_RETURN_TYPE, // TODO (danrubel) determine return type |
| 153 true, |
| 154 _isDeprecated(declaration.metadata)); |
| 155 } |
| 147 } | 156 } |
| 148 }); | 157 }); |
| 149 } | 158 } |
| 150 | 159 |
| 151 @override | 160 @override |
| 152 visitExpressionStatement(ExpressionStatement node) { | 161 visitExpressionStatement(ExpressionStatement node) { |
| 153 Expression expression = node.expression; | 162 Expression expression = node.expression; |
| 154 if (expression is SimpleIdentifier) { | 163 if (expression is SimpleIdentifier) { |
| 155 if (expression.end < request.offset) { | 164 if (expression.end < request.offset) { |
| 156 // TODO (danrubel) suggest possible names for variable declaration | 165 // TODO (danrubel) suggest possible names for variable declaration |
| (...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 575 if (name == null || name.length <= 0) { | 584 if (name == null || name.length <= 0) { |
| 576 return DYNAMIC; | 585 return DYNAMIC; |
| 577 } | 586 } |
| 578 TypeArgumentList typeArgs = type.typeArguments; | 587 TypeArgumentList typeArgs = type.typeArguments; |
| 579 if (typeArgs != null) { | 588 if (typeArgs != null) { |
| 580 //TODO (danrubel) include type arguments | 589 //TODO (danrubel) include type arguments |
| 581 } | 590 } |
| 582 return name; | 591 return name; |
| 583 } | 592 } |
| 584 } | 593 } |
| OLD | NEW |