withastro / language-tools

Language tools for Astro
MIT License
270 stars 53 forks source link

🐛 BUG: custom-attributes editor prompt not working #765

Closed J-env closed 7 months ago

J-env commented 9 months ago

Describe the Bug

Set custom properties according to the official documentation, but the editor prompt does not work. astro docs

image

Steps to Reproduce

  1. npm init astro using template
  2. create file src/custom-attributes.d.ts
  3. Enter data- attribute in astro component, editor prompt does not work
Princesseuh commented 7 months ago

Completions for HTML attributes is powered by custom data instead of types. It's done that way because HTML custom data has generally much richer information available in both how to complete the completion, the attributes value or the hover description.

It'd be nice to support somehow both types and custom data, but it's quite challenging notably because of the speed difference in getting the HTML completions vs the TS ones, not to mention the duplicate completions they'd provide.

Since this is not a bug, and more so a feature request, I'll move this to the discussion area, thank you!