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

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

Issue 1486663003: Ensure that a complete library element has constants evaluated (issue 24890) (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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_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);
}

Powered by Google App Engine
This is Rietveld 408576698