feat(language-service): expose determining the NgModule of a Directive (#32710)
This sets up the Language Service to support #32565. This PR exposes a `getDirectiveModule` method on `TypeScriptServiceHost` that returns the NgModule owning a Directive given the Directive's TypeScript node or its Angular `StaticSymbol`. Both types are supported to reduce extraneous helper methods. PR Close #32710
This commit is contained in:

committed by
Andrew Kushnir

parent
ab29874f09
commit
2846505dbd
@ -441,6 +441,14 @@ export class TypeScriptServiceHost implements LanguageServiceHost {
|
||||
return astResult;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a StaticSymbol from a file and symbol name.
|
||||
* @return Angular StaticSymbol matching the file and name, if any
|
||||
*/
|
||||
getStaticSymbol(file: string, name: string): StaticSymbol|undefined {
|
||||
return this.reflector.getStaticSymbol(file, name);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find the NgModule which the directive associated with the `classSymbol`
|
||||
* belongs to, then return its schema and transitive directives and pipes.
|
||||
|
Reference in New Issue
Block a user