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
Forward intellisense requests to their corresponding language service if they're of their interfaces #1536
Comments
I think the better solution is to enhance the Typescript typings so that the correct attribute values are suggested. This would keep things more maintainable and predictable. |
What is your reasoning for it being a more maintainable approach? As far as I know, the HTML Language Service is maintained by Microsoft and is on pair with the many specs of the web whilst as any interface we may declare will have to be hand-authored or inspected.
Though I would definitely agree on this mapping being more of a general web concern than one of Svelte on specific: any library that requires the developer of following a composable pattern on their interfaces will always have to face this issue, as a component that craves to comply with the accessibility standards of nowadays will have to expose an API to contextually apply aria & roles specs and whatnot. So if you agree that this is something that is to be provided by another extension you can close the issue. |
More maintainable because less code written |
Closing in favor of sveltejs/svelte#7649 which will have enumerated strings for things like input type etc |
Description
It is common on my projects that interactable (and sometimes normal) HTML elements share some basic behavior & styles, to the point that when building my UI/UX libraries I find myself making a generic component that is to be instanced when making any variant of the element. Said components' prop extends the interfaces that either Svelte or Typescript provides for the element it features:
And the tooling that Svelte provides is not ideal when interacting with this component, as even though the type any prop of this component accepts would be correctly inferred, the values that are deemed normal and provided by other language services (in this case, HTML's one) would not be suggested.
Proposed solution
Forward/resolve IntelliSense requests to/with their correct language services if they are of the interfaces that TypeScript provide for their language.
This solution would not only solve this use case (which I would argue is to be considered fair and normal) but would also help with CSS and whatnot.
Alternatives
No response
Additional Information, eg. Screenshots
No response
The text was updated successfully, but these errors were encountered: