Skip to content

Go to References - Where Imports Used #1485

@Jojoshua

Description

@Jojoshua

Description

I'm always frustrated when I always have to do a global file search in VSCode (ctrl + shift +F) in order to find out where a particular svelte component is used throughout the codebase. I do not assume it is imported with the same name so I will search by its path that I would expect to be in the import from

For example, given the example repo when I do a "Where Used" on Button.svelte, I would expect to see the following references

  • App.svelte
    • import Button from "./Button.svelte";
  • main.ts
    • import Button from "./Button.svelte";

Proposed solution

  1. A new menu item when you right click a .svelte file in the Explorer view named something like "Go To References" , "Find Imports", "Where Used"
    image

Running the command would then provide you a similar window as below and drilling inside the folder structure would show you the import statement for the component (blue line)

image

  1. Right clicking inside the white area of a .svelte file to provide the same menu option

image

Alternatives

Global VScode search in all files

Additional Information, eg. Screenshots

Sample repo https://github.com/Jojoshua/sveltejs-where-imports-used

Reference #1484

Metadata

Metadata

Assignees

No one assigned

    Labels

    FixedFixed in master branch. Pending production release.feature requestNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions