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

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: merge and address comments 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..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;

Powered by Google App Engine
This is Rietveld 408576698