New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(language-service): expose determining the NgModule of a Directive #32710
Conversation
This sets up the Language Service to support angular#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.
* @param node TypeScript node to get static symbol of | ||
* @return Angular StaticSymbol of the TypeScript node, if any | ||
*/ | ||
getNodeStaticSymbol(node: ts.Node): StaticSymbol|undefined { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for being pedantic, node
here seems overly broad in scope and not representative of the responsibility of the function. Why not take fileName + className?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My bad. Fixed now. Maybe it's better to just expose this.resolver
in this case; we can return a readonly version, perhaps.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The reflector has its own caches, which would be invalidated through a public API that I proposed in #32543. If it is exposed, we lose control of the caches.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you!
angular#32710) This sets up the Language Service to support angular#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 angular#32710
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
This sets up the Language Service to support #32565.
This PR exposes a
getDirectiveModule
method onTypeScriptServiceHost
that returns the NgModule owning a Directive given the Directive's
TypeScript node or its Angular
StaticSymbol
. Both types are supportedto reduce extraneous helper methods.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?