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

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

Issue 838053003: suggest fields rather than synthetic getters (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 5 years, 11 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 c32cf32b81696bb858446dfd378dbf8e5b0569d7..1bd922184e616d93ebe36d7946e66274a539db3f 100644
--- a/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
+++ b/pkg/analysis_server/lib/src/services/completion/imported_computer.dart
@@ -124,6 +124,11 @@ class _ImportedSuggestionBuilder implements SuggestionBuilder {
}
}
}
+ if (elem.isSynthetic) {
+ if (elem is PropertyAccessorElement || elem is FieldElement) {
+ return;
+ }
+ }
}
request.suggestions.add(
createElementSuggestion(elem, relevance: CompletionRelevance.DEFAULT));
@@ -149,12 +154,14 @@ class _ImportedSuggestionBuilder implements SuggestionBuilder {
String name = inheritedTypes.removeLast();
ClassElement elem = cache.importedClassMap[name];
if (visited.add(name) && elem != null) {
+ _addElementSuggestions(elem.fields);
_addElementSuggestions(elem.accessors);
_addElementSuggestions(elem.methods);
elem.allSupertypes.forEach((InterfaceType type) {
- if (visited.add(type.name)) {
- _addElementSuggestions(type.accessors);
- _addElementSuggestions(type.methods);
+ if (visited.add(type.name) && type.element != null) {
+ _addElementSuggestions(type.element.fields);
+ _addElementSuggestions(type.element.accessors);
+ _addElementSuggestions(type.element.methods);
}
});
}

Powered by Google App Engine
This is Rietveld 408576698