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

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: Updated after breaking changes Created 5 years 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 be84372ea77b97cdd1b06a3b31220fe26b893bc7..4cb0ab7415816be89a54ec62ac181638097f1948 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
@@ -86,7 +87,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;
@@ -192,7 +193,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.
@@ -262,7 +263,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