Index: pkg/analyzer_plugin/lib/utilities/completion/inherited_reference_contributor.dart |
diff --git a/pkg/analyzer_plugin/lib/utilities/completion/inherited_reference_contributor.dart b/pkg/analyzer_plugin/lib/utilities/completion/inherited_reference_contributor.dart |
index 0df654a945e6ccac5f597fb70825e7e37eccc716..868bdab2b36f3c59f5ec34f63cf8bb17961a31a4 100644 |
--- a/pkg/analyzer_plugin/lib/utilities/completion/inherited_reference_contributor.dart |
+++ b/pkg/analyzer_plugin/lib/utilities/completion/inherited_reference_contributor.dart |
@@ -44,12 +44,35 @@ class InheritedReferenceContributor extends Object |
return; |
} |
containingLibrary = request.result.libraryElement; |
- _computeSuggestionsForClass2( |
- collector, |
- target, |
- resolutionMap.elementDeclaredByClassDeclaration(classDecl), |
- request, |
- optype); |
+ _computeSuggestionsForClass2(collector, target, |
+ resolutionMap.elementDeclaredByClassDeclaration(classDecl), optype); |
+ } |
+ |
+ Future<Null> computeSuggestionsForClass( |
mfairhurst
2017/06/13 20:31:39
Could use a comment that this is here for our use
maxkim
2017/06/13 20:49:22
Acknowledged.
Brian Wilkerson
2017/06/13 20:50:19
Is this a short-term work-around until you can jus
maxkim
2017/06/13 21:11:40
This is intended to be long-term and I'll write up
|
+ CompletionRequest request, |
+ CompletionCollector collector, |
+ ClassElement classElement, { |
+ AstNode entryPoint, |
+ bool skipChildClass, |
+ OpType optype, |
+ }) async { |
+ CompletionTarget target = new CompletionTarget.forOffset( |
mfairhurst
2017/06/13 20:31:39
I would assume that we would want to pass in a Com
maxkim
2017/06/13 20:49:22
Acknowledged.
|
+ request.result.unit, request.offset, |
+ entryPoint: entryPoint); |
+ optype ??= new OpType.forCompletion(target, request.offset); |
+ if (!optype.includeIdentifiers) { |
+ return; |
+ } |
+ if (classElement == null) { |
+ ClassDeclaration classDecl = _enclosingClass(target); |
+ if (classDecl == null || classDecl.element == null) { |
+ return; |
+ } |
+ classElement = resolutionMap.elementDeclaredByClassDeclaration(classDecl); |
+ } |
+ containingLibrary = request.result.libraryElement; |
+ _computeSuggestionsForClass2(collector, target, classElement, optype, |
+ skipChildClass: skipChildClass); |
} |
_addSuggestionsForType(InterfaceType type, OpType optype, |
@@ -82,12 +105,8 @@ class InheritedReferenceContributor extends Object |
} |
} |
- void _computeSuggestionsForClass2( |
- CompletionCollector collector, |
- CompletionTarget target, |
- ClassElement classElement, |
- CompletionRequest request, |
- OpType optype, |
+ void _computeSuggestionsForClass2(CompletionCollector collector, |
+ CompletionTarget target, ClassElement classElement, OpType optype, |
{bool skipChildClass: true}) { |
bool isFunctionalArgument = target.isFunctionalArgument(); |
kind = isFunctionalArgument |