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

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

Issue 2499693002: Fixes for URI and Object completions with the new driver. (Closed)
Patch Set: Created 4 years, 1 month 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 069b07196d7a2988399a2957ddf8f7ef943df1b8..ea320bebe3d8ef1e3a027241b73a976d7028e465 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
@@ -177,8 +177,11 @@ class DartCompletionRequestImpl implements DartCompletionRequest {
@override
LibraryElement get coreLib {
- if (_coreLib == null) {
- Source coreUri = context.sourceFactory.forUri('dart:core');
+ if (result != null) {
+ AnalysisContext context = result.unit.element.context;
+ _coreLib = context.typeProvider.objectType.element.library;
+ } else {
+ Source coreUri = sourceFactory.forUri('dart:core');
_coreLib = context.computeLibraryElement(coreUri);
}
return _coreLib;
@@ -222,6 +225,11 @@ class DartCompletionRequestImpl implements DartCompletionRequest {
return _opType;
}
+ @override
+ SourceFactory get sourceFactory {
+ return context?.sourceFactory ?? result.sourceFactory;
+ }
+
/**
* Throw [AbortCompletion] if the completion request has been aborted.
*/

Powered by Google App Engine
This is Rietveld 408576698