-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve component references experience #2130
Comments
We didn't use the normal command but created a "Svelte: Find Component References" because find-reference is triggered from a symbol. But there isn't a symbol to trigger. Using the script tag as the trigger could work; we already do that in "show call hierarchy". Does that feel more intuitive to you? Or do you want And about code len, the typescript reference code len is disabled by default, probably due to performance concerns. If we add the support, we would probably disable it by default. That might not help with feature discovery. |
Ideally both types of reference view should work, I specifically did not set If the two commands |
#2130 This allows for finding current component references from the script tag. The advantage of this is that you can now use the "Find All References" command for component references. This will always open in the sidebar without setting the references.preferredLocation config. While we're on this topic, I also map the reference for a component to "find component references". Currently, these are only the references for the file that was requested. The reason is that the name of the generated component is suffixed, so any import will be an aliased default import. Thus, TypeScript only searches within the same file.
#2130 Porting VSCode's implementation/reference code lens. This is not enabled by default. To enable this, you'll need to enable the typescript.implementationsCodeLens.enabled config or the typescript.referencesCodeLens.enabled config for lang="ts" and javascript.referencesCodeLens.enabled for js components. Note that we reuse config for ts/js files so it'll also enable the feature in ts/js files.
Description
There currently is no intuitive way to find references to a component from within the component.
Svelte: Find Component References
Go to References
(would be equivalent to above command)References: Find All References
(has no equivalent, shows references in the side bar)Proposed solution
Svelte: Find Component References
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...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
The text was updated successfully, but these errors were encountered: