Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Unified Diff: pkg/analysis_server/lib/src/services/completion/dart_completion_manager.dart

Issue 815683002: support part file completions (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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;

Powered by Google App Engine
This is Rietveld 408576698