| Index: pkg/analysis_server/lib/src/services/completion/imported_computer.dart
|
| diff --git a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
|
| index 35e063dfcf4a4f99de5b178a13c67548a442f740..a74910ca2dbf4bb410c5d00fbc5b33c0224474b3 100644
|
| --- a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
|
| +++ b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
|
| @@ -21,7 +21,7 @@ import 'package:analyzer/src/generated/scanner.dart';
|
| * `completion.getSuggestions` request results.
|
| */
|
| class ImportedComputer extends DartCompletionComputer {
|
| - final bool shouldWaitForLowPrioritySuggestions;
|
| + bool shouldWaitForLowPrioritySuggestions;
|
| _ImportedSuggestionBuilder builder;
|
|
|
| ImportedComputer({this.shouldWaitForLowPrioritySuggestions: false});
|
| @@ -30,7 +30,8 @@ class ImportedComputer extends DartCompletionComputer {
|
| bool computeFast(DartCompletionRequest request) {
|
| builder = request.node.accept(new _ImportedAstVisitor(request));
|
| if (builder != null) {
|
| - builder.shouldWaitForLowPrioritySuggestions = shouldWaitForLowPrioritySuggestions;
|
| + builder.shouldWaitForLowPrioritySuggestions =
|
| + shouldWaitForLowPrioritySuggestions;
|
| return builder.computeFast(request.node);
|
| }
|
| return true;
|
| @@ -251,12 +252,14 @@ class _ImportedSuggestionBuilder implements SuggestionBuilder {
|
| return new Future.value(true);
|
| }
|
|
|
| - Future future = cache.computeImportInfo(request.unit, request.searchEngine);
|
| - if (shouldWaitForLowPrioritySuggestions) {
|
| + Future future = null;
|
| + if (!cache.isImportInfoCached(request.unit)) {
|
| + future = cache.computeImportInfo(request.unit, request.searchEngine);
|
| + }
|
| + if (future != null && shouldWaitForLowPrioritySuggestions) {
|
| return future.then(addSuggestions);
|
| - } else {
|
| - return addSuggestions(true);
|
| }
|
| + return addSuggestions(true);
|
| }
|
|
|
| /**
|
|
|