Skip to content

VSCode can't find references when using JSDoc #2910

@FedericoGarciaGarcia

Description

@FedericoGarciaGarcia

Describe the bug

VS Code can't find references in Svelte files that are imported with JSDoc.

Example:

  • Export class MyClass from utils.ts
  • Import it in a component with TypeScript: ✅ works
  • Import it in a component with JSDoc: ❌ fails

As shown in the screenshot below, the component importing MyClass with JSDoc (SampleJs.svelte) is not found. Only SampleTs.svelte is found:

Image

Other ways of importing like /** @typedef { import('./utils').MyClass } MyClass */ don't work either.

I tried both the "Svelte for VS Code" extension and manually installing and setting up typescript-svelte-plugin

Reproduction

  1. Export a declaration from a JS/TS file
  2. Import it in a Svelte component with JSDoc
  3. In the exporting file, right click the declaration and select "Find All References"
  4. The Svelte component won't show up in "References"

Expected behaviour

The Svelte component should show up in "References"

System Info

  • OS: macOS
  • IDE: VSCode

Which package is the issue about?

Svelte for VS Code extension

Additional Information, eg. Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions