Skip to content

Improve component references experience #2130

@brunnerh

Description

@brunnerh

Description

There currently is no intuitive way to find references to a component from within the component.

  • One has to know about the special command Svelte: Find Component References
  • The regular commands do not work:
    • Go to References (would be equivalent to above command)
    • References: Find All References (has no equivalent, shows references in the side bar)

Proposed solution

  • Add a lens at the top of the component file that behaves like that in JS/TS files
    image
    • If the count cannot easily be determined dynamically it could just say "Go to references"
    • Essentially already implemented as Svelte: Find Component References
  • If there is a way to make the standard commands work, integrate them.
    Since those can be used on other symbols, I was thinking that maybe with the cursor on the <script> tag it could search for component references. Of course still not ideal, as components can just omit that entirely as well...
  • If standard commands can not be integrated, maybe add a separate Svelte: ... command that shows references in the side bar, not sure if that is possible either, though.

Alternatives

Stick with Svelte: Find Component References and global search, if a more persistent list is required (e.g. for checking every single usage site).

Additional Information, eg. Screenshots

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

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

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions