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

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

Issue 1004343002: Completion should not show overridden inherited methods (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: merge 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
Index: pkg/analysis_server/lib/src/services/completion/imported_computer.dart
diff --git a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
index e8da6efa37dc25faa45492c82bbf09995fbaa2c1..20315572da68d3f98689dc9653f781b119351e7e 100644
--- a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
@@ -80,14 +80,9 @@ class _ImportedSuggestionBuilder extends ElementSuggestionBuilder
final DartCompletionRequest request;
final OpType optype;
DartCompletionCache cache;
- HashSet<String> completions;
_ImportedSuggestionBuilder(this.request, this.optype) {
cache = request.cache;
- completions = new HashSet<String>();
- for (CompletionSuggestion suggestion in request.suggestions) {
- completions.add(suggestion.completion);
- }
}
@override
@@ -175,11 +170,11 @@ class _ImportedSuggestionBuilder extends ElementSuggestionBuilder
unfiltered.forEach((CompletionSuggestion suggestion) {
if (filterText.length > 0) {
if (suggestion.completion.startsWith(filterText)) {
- _addSuggestion(suggestion);
+ request.addSuggestion(suggestion);
}
} else {
if (suggestion.relevance != DART_RELEVANCE_LOW) {
- _addSuggestion(suggestion);
+ request.addSuggestion(suggestion);
}
}
});
@@ -226,16 +221,6 @@ class _ImportedSuggestionBuilder extends ElementSuggestionBuilder
}
/**
- * Add suggestion if an identically named suggestion
- * has not already been added.
- */
- void _addSuggestion(CompletionSuggestion suggestion) {
- if (completions.add(suggestion.completion)) {
- request.suggestions.add(suggestion);
- }
- }
-
- /**
* Add suggested based upon imported elements.
*/
void _addSuggestions(AstNode node) {

Powered by Google App Engine
This is Rietveld 408576698