| 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.contributor.dart.invocation; | 5 library services.completion.contributor.dart.invocation; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 | 8 |
| 9 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; | 9 import 'package:analysis_server/src/services/completion/dart_completion_manager.
dart'; |
| 10 import 'package:analysis_server/src/services/completion/local_declaration_visito
r.dart'; | 10 import 'package:analysis_server/src/services/completion/local_declaration_visito
r.dart'; |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 397 for (Directive directive in request.unit.directives) { | 397 for (Directive directive in request.unit.directives) { |
| 398 if (directive is ImportDirective) { | 398 if (directive is ImportDirective) { |
| 399 if (directive.prefix != null) { | 399 if (directive.prefix != null) { |
| 400 if (directive.prefix.name == element.name) { | 400 if (directive.prefix.name == element.name) { |
| 401 // Suggest elements from the imported library | 401 // Suggest elements from the imported library |
| 402 LibraryElement library = directive.uriElement; | 402 LibraryElement library = directive.uriElement; |
| 403 AstNode node = request.target.containingNode; | 403 AstNode node = request.target.containingNode; |
| 404 bool typesOnly = node.parent is TypeName; | 404 bool typesOnly = node.parent is TypeName; |
| 405 bool instCreation = | 405 bool instCreation = |
| 406 typesOnly && node.parent.parent is ConstructorName; | 406 typesOnly && node.parent.parent is ConstructorName; |
| 407 LibraryElementSuggestionBuilder.suggestionsFor(request, | 407 LibraryElementSuggestionBuilder.suggestionsFor( |
| 408 CompletionSuggestionKind.INVOCATION, library, typesOnly, | 408 request, |
| 409 CompletionSuggestionKind.INVOCATION, |
| 410 library, |
| 411 typesOnly, |
| 409 instCreation); | 412 instCreation); |
| 410 modified = true; | 413 modified = true; |
| 411 if (directive.deferredKeyword != null) { | 414 if (directive.deferredKeyword != null) { |
| 412 FunctionElement loadLibFunct = library.loadLibraryFunction; | 415 FunctionElement loadLibFunct = library.loadLibraryFunction; |
| 413 request.addSuggestion(createSuggestion(loadLibFunct)); | 416 request.addSuggestion(createSuggestion(loadLibFunct)); |
| 414 } | 417 } |
| 415 } | 418 } |
| 416 } | 419 } |
| 417 } | 420 } |
| 418 } | 421 } |
| (...skipping 11 matching lines...) Expand all Loading... |
| 430 } | 433 } |
| 431 return new Future.value(false); | 434 return new Future.value(false); |
| 432 } | 435 } |
| 433 | 436 |
| 434 @override | 437 @override |
| 435 Future<bool> visitVariableElement(VariableElement element) { | 438 Future<bool> visitVariableElement(VariableElement element) { |
| 436 InterfaceTypeSuggestionBuilder.suggestionsFor(request, element.type); | 439 InterfaceTypeSuggestionBuilder.suggestionsFor(request, element.type); |
| 437 return new Future.value(true); | 440 return new Future.value(true); |
| 438 } | 441 } |
| 439 } | 442 } |
| OLD | NEW |