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 6f182d813487e9dfbb72823ce03eeff57dff2962..904f1c210db9466e84abd2670a8b8ad8f496fb46 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 |
@@ -22,6 +22,7 @@ import 'package:analyzer/src/generated/engine.dart' hide AnalysisContextImpl; |
import 'package:analyzer/src/generated/source.dart'; |
import 'package:analyzer/src/task/dart.dart'; |
import 'package:analyzer/task/dart.dart'; |
+import 'package:analyzer/src/generated/element.dart'; |
/** |
* [DartCompletionManager] determines if a completion request is Dart specific |
@@ -99,6 +100,20 @@ class DartCompletionRequestImpl extends CompletionRequestImpl |
} |
@override |
+ Future<LibraryElement> resolveContainingLibrary() async { |
scheglov
2015/12/07 16:16:15
It seems that the documentation for the method and
danrubel
2015/12/07 16:59:38
Good point. This is not meant to resolve the libra
|
+ //TODO(danrubel) resolve the library element |
+ // rather than all the declarations |
+ CompilationUnit unit = await resolveDeclarationsInScope(); |
+ if (unit != null) { |
+ CompilationUnitElement elem = unit.element; |
+ if (elem != null) { |
+ return elem.library; |
+ } |
+ } |
+ return null; |
+ } |
+ |
+ @override |
Future<CompilationUnit> resolveDeclarationsInScope() async { |
CompilationUnit unit = target.unit; |
if (_haveResolveDeclarationsInScope) { |