| 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 87ae27c618fa7c0b401792e8609017edf7602af5..f1e7198937ac0e13e794be23acb3b9497e1f46b8 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
|
| @@ -66,6 +66,11 @@ class DartCompletionCache extends CompletionCache {
|
| */
|
| Map<String, ClassElement> importedClassMap;
|
|
|
| + /**
|
| + * The [ClassElement] for Object.
|
| + */
|
| + ClassElement _objectClassElement;
|
| +
|
| DartCompletionCache(AnalysisContext context, Source source)
|
| : super(context, source);
|
|
|
| @@ -132,6 +137,7 @@ class DartCompletionCache extends CompletionCache {
|
| }
|
| addSuggestion(elem, CompletionRelevance.DEFAULT);
|
| });
|
| + _objectClassElement = importedClassMap['Object'];
|
|
|
| /*
|
| * Don't wait for search of lower relevance results to complete.
|
| @@ -159,6 +165,20 @@ class DartCompletionCache extends CompletionCache {
|
| }
|
|
|
| /**
|
| + * Return the [ClassElement] for Object.
|
| + */
|
| + ClassElement get objectClassElement {
|
| + if (_objectClassElement == null) {
|
| + Source coreUri = context.sourceFactory.forUri('dart:core');
|
| + LibraryElement coreLib = context.getLibraryElement(coreUri);
|
| + Namespace coreNamespace =
|
| + new NamespaceBuilder().createPublicNamespaceForLibrary(coreLib);
|
| + _objectClassElement = coreNamespace.definedNames['Object'];
|
| + }
|
| + return _objectClassElement;
|
| + }
|
| +
|
| + /**
|
| * Return `true` if the import information is cached for the given
|
| * compilation unit.
|
| */
|
|
|