computeSuggestions method
Future<void>
computeSuggestions(
- covariant DartCompletionRequest request,
- CompletionCollector collector
override
Plugin contributors should primarily overload this function. Should more
parameters be needed for autocompletion needs, the overloaded function
should define those parameters and call on computeSuggestionsForClass
.
Implementation
@override
Future<void> computeSuggestions(
DartCompletionRequest request, CompletionCollector collector) async {
var target =
CompletionTarget.forOffset(request.result.unit, request.offset);
var optype = OpType.forCompletion(target, request.offset);
if (!optype.includeIdentifiers) {
return;
}
var classDecl = _enclosingClass(target);
if (classDecl == null || classDecl.declaredElement == null) {
return;
}
containingLibrary = request.result.libraryElement;
_computeSuggestionsForClass2(
collector, target, classDecl.declaredElement!, optype);
}