Chromium Code Reviews| Index: pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart |
| diff --git a/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart b/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart |
| index 5426d294ad60a3b8deefd78f3bc2b8e9779ef4d0..5d743f4ce9864db4437fc9a585b09639662b4f44 100644 |
| --- a/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart |
| +++ b/pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart |
| @@ -79,7 +79,7 @@ class DartCompletionManager extends CompletionManager { |
| Future<bool> computeCache() { |
| return waitForAnalysis().then((CompilationUnit unit) { |
| if (unit != null && !cache.isImportInfoCached(unit)) { |
| - return cache.computeImportInfo(unit, searchEngine); |
| + return cache.computeImportInfo(unit, searchEngine, true); |
| } else { |
| return new Future.value(false); |
| } |
| @@ -189,9 +189,16 @@ class DartCompletionManager extends CompletionManager { |
| * compilation unit is never going to be resolved. |
| */ |
| Future<CompilationUnit> waitForAnalysis() { |
| + List<Source> libraries = context.getLibrariesContaining(source); |
| + assert(libraries != null); |
|
Paul Berry
2014/12/19 19:13:30
Nit pick: the change you've made adds assertions,
|
| + if (libraries.length == 0) { |
| + return new Future.value(null); |
| + } |
| + Source libSource = libraries[0]; |
| + assert(libSource != null); |
| return context.computeResolvedCompilationUnitAsync( |
| source, |
| - source).catchError((_) { |
| + libSource).catchError((_) { |
| // This source file is not scheduled for analysis, so a resolved |
| // compilation unit is never going to get computed. |
| return null; |