Skip to content

Go to declaration without a symbol #76

@geecu

Description

@geecu

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 <template> tag. These HTML files are passed to a webpack loader that wraps them in a <template> 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 <script> 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 )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions