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..2a5acd7ddca12a2d12bb83891dbca47e50eb26b3 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 |
| @@ -189,9 +189,13 @@ class DartCompletionManager extends CompletionManager { |
| * compilation unit is never going to be resolved. |
| */ |
| Future<CompilationUnit> waitForAnalysis() { |
| + List<Source> libraries = context.getLibrariesContaining(source); |
| + if (libraries == null || libraries.length == 0 || libraries[0] == null) { |
|
Paul Berry
2014/12/18 18:37:02
Are all of these possibilities expected to arise i
danrubel
2014/12/19 18:46:09
The dartdoc does not clearly state that it will no
|
| + return new Future.value(null); |
| + } |
| return context.computeResolvedCompilationUnitAsync( |
| source, |
| - source).catchError((_) { |
| + libraries[0]).catchError((_) { |
| // This source file is not scheduled for analysis, so a resolved |
| // compilation unit is never going to get computed. |
| return null; |