✨ Use custom element's JSDoc as doc for completion/hover
Currently, custom elements added to SvelteHTMLElements supports autocompletion, but no description is displayed (from the JSDoc), while their attributes support both autocompletion and JSDoc description.
This PR's goal is to enable JSDoc documentation during autocompletion and hover for custom element's tags.
For example, this declaration would yield this autocomplete:
declare module 'svelte/elements' {
export interface SvelteHTMLElements {
/**
* Custom doc for custom element
*
* ### Details
* Some interesting stuff about this component (in markdown)
*/
'custom-element': any;
}
}
⚠️ No Changeset found
Latest commit: 6a70acadf1464e4b3547427dbade028d786dcfe2
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Click here to learn what changesets are, and how to add one.
Click here if you're a maintainer who wants to add a changeset to this PR
I think it would be better to resolve the documentation in resolveCompletion. Could you check if it's possible? This way, it'll only calculate the documentation when it's needed. In hover, the reused method also only needs to calculate the documentation needed instead of all the customer elements.
I'm away from home the next few days, but I'll look into that shortly.