getCodeUnitWithClassMethod method

CodeUnit? getCodeUnitWithClassMethod(
  1. String fName, {
  2. bool caseInsensitive = false,
})

Returns the 1st CodeUnit with a class method of name fName.

Implementation

CodeUnit? getCodeUnitWithClassMethod(String fName,
    {bool caseInsensitive = false}) {
  for (var cu in _codeUnits) {
    if (cu.root!.classes.any((c) => c.containsFunctionWithName(fName))) {
      return cu;
    }
  }
  return null;
}