A ts-morph Project instance with source files already added.
componentDecorators: project component decorators in addition
to Component (parser.componentDecorators), used for template usages.
Finds all usages of the named symbol across the project.
The symbol name to search for (class, method, function, variable, constant).
Optional filters for file scope and usage type.
Array of resolved usages, sorted by file path then line number.
Finds all references to named symbols (class, method, function, variable, constant) across a ts-morph Project, e.g. to determine call paths and blast radius before a fix.
Remarks
Uses ts-morph
findReferences()under the hood. The project must already have the relevant source files added before calling UsageFinder.findUsages.Two additional sources close gaps that would otherwise produce a false "0 usages" all-clear:
unresolved: same-name identifiers whose symbol does not resolve (e.g. a class still used as a type after its import was removed, TS2304).template: Angular template usages (component/directive selectors, pipe names, member reads/calls/bindings) intemplateUrlfiles and inline templates, see TemplateUsageFinder.Example