tomblachut / svelte-intellij

Svelte components in WebStorm and friends
MIT License
482 stars 38 forks source link

Support NPM Workspaces for "Go to Declaration" #295

Closed davjhan closed 1 year ago

davjhan commented 2 years ago

What

Assume you have an NPM workspace setup properly like so:

Project Root
  - Library A
        - A.svelte
  - Library B
        - B.svelte

And in A.svelte, I import component B.svelte from the sub package @davjhan/LibraryB

    import B from '@davjhan/LibraryB/src/B.svelte'

When right click on B "Go To > Declaration or Usages" or simply command click on B, I expect it to take me to the definition source in /Library B/B.svelte. However, it says "No Declarations Found".

If I right click on the path ('@davjhan/LibraryB/src/B.svelte'), and go to declaration or usages, it sends me to a readonly version of this file in node_modules.

It works when...

<script lang=ts>
    import B from '@davjhan/LibraryB/src/B.svelte'
</script>
tomblachut commented 1 year ago

We made lots of improvements around this problem during the last year. If the issue still persist please open another issue on YouTrack.