| 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.dart.cache; | 5 library services.completion.dart.cache; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 | 9 |
| 10 import 'package:analysis_server/src/protocol_server.dart' | 10 import 'package:analysis_server/src/protocol_server.dart' |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 298 CompletionSuggestion suggestion = | 298 CompletionSuggestion suggestion = |
| 299 createSuggestion(element, relevance: relevance); | 299 createSuggestion(element, relevance: relevance); |
| 300 | 300 |
| 301 if (element is ExecutableElement) { | 301 if (element is ExecutableElement) { |
| 302 DartType returnType = element.returnType; | 302 DartType returnType = element.returnType; |
| 303 if (returnType != null && returnType.isVoid) { | 303 if (returnType != null && returnType.isVoid) { |
| 304 importedVoidReturnSuggestions.add(suggestion); | 304 importedVoidReturnSuggestions.add(suggestion); |
| 305 } else { | 305 } else { |
| 306 otherImportedSuggestions.add(suggestion); | 306 otherImportedSuggestions.add(suggestion); |
| 307 } | 307 } |
| 308 } else if (element is FunctionTypeAliasElement) { |
| 309 importedTypeSuggestions.add(suggestion); |
| 308 } else if (element is ClassElement) { | 310 } else if (element is ClassElement) { |
| 309 importedTypeSuggestions.add(suggestion); | 311 importedTypeSuggestions.add(suggestion); |
| 310 _addConstructorSuggestions(element, relevance); | 312 _addConstructorSuggestions(element, relevance); |
| 311 } else { | 313 } else { |
| 312 otherImportedSuggestions.add(suggestion); | 314 otherImportedSuggestions.add(suggestion); |
| 313 } | 315 } |
| 314 _importedCompletions.add(suggestion.completion); | 316 _importedCompletions.add(suggestion.completion); |
| 315 } | 317 } |
| 316 | 318 |
| 317 /** | 319 /** |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 @override | 378 @override |
| 377 void visitFunctionTypeAliasElement(FunctionTypeAliasElement element) { | 379 void visitFunctionTypeAliasElement(FunctionTypeAliasElement element) { |
| 378 cache._addSuggestion(element, DART_RELEVANCE_DEFAULT); | 380 cache._addSuggestion(element, DART_RELEVANCE_DEFAULT); |
| 379 } | 381 } |
| 380 | 382 |
| 381 @override | 383 @override |
| 382 void visitTopLevelVariableElement(TopLevelVariableElement element) { | 384 void visitTopLevelVariableElement(TopLevelVariableElement element) { |
| 383 cache._addSuggestion(element, DART_RELEVANCE_DEFAULT); | 385 cache._addSuggestion(element, DART_RELEVANCE_DEFAULT); |
| 384 } | 386 } |
| 385 } | 387 } |
| OLD | NEW |