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

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

Issue 1008533002: Completion breaks if core is not analyzed (issue 22814) (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 9 months 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ca9c75af65e6c471ad515c08355faa971a30fec0..9cc5f663d05dbc5a8e0636aa3ea9ac2eb5e78327 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
@@ -198,6 +198,11 @@ class DartCompletionCache extends CompletionCache {
void _addDartCoreSuggestions() {
Source coreUri = context.sourceFactory.forUri('dart:core');
LibraryElement coreLib = context.getLibraryElement(coreUri);
+ if (coreLib == null) {
+ // If the core library has not been analyzed yet, then we cannot add any
+ // suggestions from it.
+ return;
+ }
Namespace coreNamespace =
new NamespaceBuilder().createPublicNamespaceForLibrary(coreLib);
coreNamespace.definedNames.forEach((String name, Element elem) {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698