-
-
Notifications
You must be signed in to change notification settings - Fork 196
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) event completion/hover for components with a type definition #1057
Conversation
W00t this is awesome! I was thinking about something like this recently (analyzing the TS AST ourselves) and now you open this PR 😄 I'll take a closer look later, excited for this! |
|
||
return new JsOrTsComponentInfoProvider(typeChecker, classType); | ||
} | ||
} |
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.
What do you think about making the instance of this a property on TsOrJsDocumentSnapshot? Then it could be cached and the cache would only be deleted on updates to the snapshot.
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.
Not sure about the performance implications, but could this be something we could also use for the svelte2tsx-components? Then we could ditch our own implementation of creating the "events" property on the svelte2tsx return type.
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.
Cached in the snapshot seems like a good idea.
could this be something we could also use for the svelte2tsx-components
Yes. Tried with svelte2tsx-component. The biggest difference between this and the svelte2tsx approach is the fallback Event in the svelte2tsx.
Do you have time to add the caching logic the next few days or should I take over? This feature is too nice to not get it in as part of the next release 😄 |
OK. I'll add the caching logic soon |
…nto event-info-dts
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.
🎉
Provide event hover info and completion for components with a type definition, mainly for components in component libraries.