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

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

Issue 1517693004: extract LibraryPrefixContributor from imported reference contributor (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: merge 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 2fbe91e867184ade29e1fb3b1c645591e6d12ee7..be84372ea77b97cdd1b06a3b31220fe26b893bc7 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
@@ -31,12 +31,6 @@ class DartCompletionCache extends CompletionCache {
String _importKey;
/**
- * Library prefix suggestions based upon imports,
- * or `null` if nothing has been cached.
- */
- List<CompletionSuggestion> libraryPrefixSuggestions;
-
- /**
* Type suggestions based upon imports,
* or `null` if nothing has been cached.
*/
@@ -114,7 +108,6 @@ class DartCompletionCache extends CompletionCache {
Future<bool> computeImportInfo(CompilationUnit unit,
SearchEngine searchEngine, bool shouldWaitForLowPrioritySuggestions) {
importedTypeSuggestions = <CompletionSuggestion>[];
- libraryPrefixSuggestions = <CompletionSuggestion>[];
otherImportedSuggestions = <CompletionSuggestion>[];
importedConstructorSuggestions = <CompletionSuggestion>[];
importedVoidReturnSuggestions = <CompletionSuggestion>[];
@@ -240,8 +233,9 @@ class DartCompletionCache extends CompletionCache {
} else {
// Exclude elements from prefixed imports
// because they are provided by PrefixedElementContributor
- _addLibraryPrefixSuggestion(importElem);
- excludedLibs.add(importElem.importedLibrary);
+ // Suggested by LibraryPrefixContributor
+ // _addLibraryPrefixSuggestion(importElem);
+ // excludedLibs.add(importElem.importedLibrary);
}
}
} else if (directive is PartDirective) {
@@ -257,27 +251,6 @@ class DartCompletionCache extends CompletionCache {
}
}
- void _addLibraryPrefixSuggestion(ImportElement importElem) {
- CompletionSuggestion suggestion = null;
- String completion = importElem.prefix.displayName;
- if (completion != null && completion.length > 0) {
- suggestion = new CompletionSuggestion(
- CompletionSuggestionKind.INVOCATION,
- DART_RELEVANCE_DEFAULT,
- completion,
- completion.length,
- 0,
- importElem.isDeprecated,
- false);
- LibraryElement lib = importElem.importedLibrary;
- if (lib != null) {
- suggestion.element = convertElement(lib);
- }
- libraryPrefixSuggestions.add(suggestion);
- _importedCompletions.add(suggestion.completion);
- }
- }
-
/**
* Add suggestions for all top level elements in the context
* excluding those elemnents for which suggestions have already been added.

Powered by Google App Engine
This is Rietveld 408576698