JetBrains / JetBrains/web-types
Go to declaration without a symbol
- Dominant language
- TypeScript
- Stars
- 306
- Forks
- 25
- PR merge metrics
- No merged PRs in 30d
Description
I'm working on a (proprietary) library that allows developers to define vue components by putting their templates in HTML files - just the HTML contents, without the `` tag. These HTML files are passed to a webpack loader that wraps them in a `` tag before passing them to the vue-loader.
web-types is a great fit for this usecase and it works great for autocompletion: besides autocompleting the tag name, the loader also looks for `props.propName` in the HTML and defines the props on the fly, so web-types autocompletes the props too. But I can't get "Go to declaration" to work - it seems that the two ways that web-types support (`file` or `module`) both require a symbol.
I've set up a sample repository: https://github.com/geecu/web-types-source . The component is defined here: https://github.com/geecu/web-types-source/blob/main/src/components/hero.html and used here: https://github.com/geecu/web-types-source/blob/main/src/templates/index.html .
On the branch `class` ( https://github.com/geecu/web-types-source/tree/class ) I've added a `` tag to the component that defines a class ( https://github.com/geecu/web-types-source/blob/class/src/components/hero.html#L2 ) - with this Go to declaration works, but it's a hassle to ask developers to add this to every component.
I've also setup a branch with a sample for custom-elements-manifest https://github.com/geecu/web-types-source/tree/custom-elements , using the example provided at https://github.com/webcomponents/custom-elements-manifest . Go to declaration doesn't work for `my-element` neither: https://github.com/geecu/web-types-source/blob/custom-elements/src/templates/index.html .
PS: I'm using PhpStorm 2023.3 ( Build #PS-233.11799.232, built on December 1, 2023 )
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.