computeSuggestionsForClass method

Future<void> computeSuggestionsForClass(
  1. DartCompletionRequest request,
  2. CompletionCollector collector,
  3. ClassElement? classElement, {
  4. AstNode? entryPoint,
  5. bool skipChildClass = true,
  6. CompletionTarget? target,
  7. OpType? optype,
})

Clients should not overload this function.

Implementation

Future<void> computeSuggestionsForClass(
  DartCompletionRequest request,
  CompletionCollector collector,
  ClassElement? classElement, {
  AstNode? entryPoint,
  bool skipChildClass = true,
  CompletionTarget? target,
  OpType? optype,
}) async {
  entryPoint ??= request.result.unit;
  target ??= CompletionTarget.forOffset(entryPoint, request.offset);
  optype ??= OpType.forCompletion(target, request.offset);
  if (!optype.includeIdentifiers) {
    return;
  }
  if (classElement == null) {
    var classDecl = _enclosingClass(target);
    if (classDecl == null || classDecl.declaredElement == null) {
      return;
    }
    classElement = classDecl.declaredElement;
  }
  containingLibrary = request.result.libraryElement;
  _computeSuggestionsForClass2(collector, target, classElement!, optype,
      skipChildClass: skipChildClass);
}