Index: pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart |
diff --git a/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart b/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart |
index 2fbe91e867184ade29e1fb3b1c645591e6d12ee7..f01d1f6468c8100fc44d667e78ba879e285d083e 100644 |
--- a/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart |
+++ b/pkg/analysis_server/lib/src/services/completion/dart_completion_cache.dart |
@@ -18,6 +18,7 @@ import 'package:analyzer/src/generated/element.dart'; |
import 'package:analyzer/src/generated/engine.dart'; |
import 'package:analyzer/src/generated/resolver.dart'; |
import 'package:analyzer/src/generated/source.dart'; |
+import 'package:analyzer/src/task/dart.dart'; |
/** |
* The `DartCompletionCache` contains cached information from a prior code |
@@ -92,7 +93,7 @@ class DartCompletionCache extends CompletionCache { |
ClassElement get objectClassElement { |
if (_objectClassElement == null) { |
Source coreUri = context.sourceFactory.forUri('dart:core'); |
- LibraryElement coreLib = context.getLibraryElement(coreUri); |
+ LibraryElement coreLib = context.getResult(coreUri, LIBRARY_ELEMENT8); |
_objectClassElement = coreLib.getType('Object'); |
} |
return _objectClassElement; |
@@ -199,7 +200,7 @@ class DartCompletionCache extends CompletionCache { |
*/ |
void _addDartCoreSuggestions() { |
Source coreUri = context.sourceFactory.forUri('dart:core'); |
- LibraryElement coreLib = context.getLibraryElement(coreUri); |
+ LibraryElement coreLib = context.getResult(coreUri, LIBRARY_ELEMENT8); |
if (coreLib == null) { |
// If the core library has not been analyzed yet, then we cannot add any |
// suggestions from it. |
@@ -289,7 +290,7 @@ class DartCompletionCache extends CompletionCache { |
if (lib.isInternal) { |
Source libUri = context.sourceFactory.forUri(lib.shortName); |
if (libUri != null) { |
- LibraryElement libElem = context.getLibraryElement(libUri); |
+ LibraryElement libElem = context.getResult(libUri, LIBRARY_ELEMENT8); |
if (libElem != null) { |
excludedLibs.add(libElem); |
} |