| 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.toplevel; | 5 library services.completion.computer.dart.toplevel; |
| 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' hide Element, | 10 import 'package:analysis_server/src/protocol_server.dart' hide Element, |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 Future<bool> computeFull(AstNode node) { | 86 Future<bool> computeFull(AstNode node) { |
| 87 | 87 |
| 88 Future<bool> addSuggestions(_) { | 88 Future<bool> addSuggestions(_) { |
| 89 _addInheritedSuggestions(node); | 89 _addInheritedSuggestions(node); |
| 90 _addTopLevelSuggestions(); | 90 _addTopLevelSuggestions(); |
| 91 return new Future.value(true); | 91 return new Future.value(true); |
| 92 } | 92 } |
| 93 | 93 |
| 94 Future future = null; | 94 Future future = null; |
| 95 if (!cache.isImportInfoCached(request.unit)) { | 95 if (!cache.isImportInfoCached(request.unit)) { |
| 96 future = cache.computeImportInfo(request.unit, request.searchEngine); | 96 future = cache.computeImportInfo( |
| 97 request.unit, |
| 98 request.searchEngine, |
| 99 shouldWaitForLowPrioritySuggestions); |
| 97 } | 100 } |
| 98 if (future != null && shouldWaitForLowPrioritySuggestions) { | 101 if (future != null) { |
| 99 return future.then(addSuggestions); | 102 return future.then(addSuggestions); |
| 100 } | 103 } |
| 101 return addSuggestions(true); | 104 return addSuggestions(true); |
| 102 } | 105 } |
| 103 | 106 |
| 104 /** | 107 /** |
| 105 * Add imported element suggestions. | 108 * Add imported element suggestions. |
| 106 */ | 109 */ |
| 107 void _addElementSuggestions(List<Element> elements) { | 110 void _addElementSuggestions(List<Element> elements) { |
| 108 elements.forEach((Element elem) { | 111 elements.forEach((Element elem) { |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 191 addFilteredSuggestions(cache.importedTypeSuggestions); | 194 addFilteredSuggestions(cache.importedTypeSuggestions); |
| 192 addFilteredSuggestions(cache.libraryPrefixSuggestions); | 195 addFilteredSuggestions(cache.libraryPrefixSuggestions); |
| 193 if (!typesOnly) { | 196 if (!typesOnly) { |
| 194 addFilteredSuggestions(cache.otherImportedSuggestions); | 197 addFilteredSuggestions(cache.otherImportedSuggestions); |
| 195 if (!excludeVoidReturn) { | 198 if (!excludeVoidReturn) { |
| 196 addFilteredSuggestions(cache.importedVoidReturnSuggestions); | 199 addFilteredSuggestions(cache.importedVoidReturnSuggestions); |
| 197 } | 200 } |
| 198 } | 201 } |
| 199 } | 202 } |
| 200 } | 203 } |
| OLD | NEW |