Chromium Code Reviews| Index: pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart |
| diff --git a/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart b/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart |
| index 80ddd8560414003336112be61692682d28e3cd84..2588c54bf318d97ef5c5698a885b298564dc0798 100644 |
| --- a/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart |
| +++ b/pkg/analysis_server/lib/src/services/completion/suggestion_builder.dart |
| @@ -345,12 +345,18 @@ class InterfaceTypeSuggestionBuilder { |
| } |
| } |
| - void _buildSuggestions(InterfaceType type, LibraryElement library) { |
| + void _buildSuggestions( |
| + InterfaceType type, LibraryElement library, bool isSuper) { |
| // Visit all of the types in the class hierarchy, collecting possible |
| // completions. If multiple elements are found that complete to the same |
| // identifier, addSuggestion will discard all but the first (with a few |
| // exceptions to handle getter/setter pairs). |
| - for (InterfaceType targetType in _getTypeOrdering(type)) { |
| + List<InterfaceType> types = _getTypeOrdering(type); |
| + if (isSuper) { |
| + // Do not suggest members from the target type if the target is "super" |
|
Paul Berry
2015/05/05 02:41:27
If the target is "super", then members from interf
danrubel
2015/05/05 20:03:18
Great point. Fixed.
|
| + types.remove(type); |
| + } |
| + for (InterfaceType targetType in types) { |
| for (MethodElement method in targetType.methods) { |
| // Exclude static methods when completion on an instance |
| if (!method.isStatic) { |
| @@ -412,7 +418,8 @@ class InterfaceTypeSuggestionBuilder { |
| /** |
| * Add suggestions for the visible members in the given interface |
| */ |
| - static void suggestionsFor(DartCompletionRequest request, DartType type) { |
| + static void suggestionsFor(DartCompletionRequest request, DartType type, |
| + {bool isSuper: false}) { |
| CompilationUnit compilationUnit = |
| request.target.containingNode.getAncestor((n) => n is CompilationUnit); |
| LibraryElement library = compilationUnit.element.library; |
| @@ -421,7 +428,7 @@ class InterfaceTypeSuggestionBuilder { |
| } |
| if (type is InterfaceType) { |
| return new InterfaceTypeSuggestionBuilder(request)._buildSuggestions( |
| - type, library); |
| + type, library, isSuper); |
| } |
| } |
| } |