Skip to content
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

A command like Go To References, but don't list imports or implementations #147415

Closed
joeytwiddle opened this issue Apr 13, 2022 · 3 comments
Closed
Assignees
Labels
feature-request Request for new features or functionality

Comments

@joeytwiddle
Copy link

joeytwiddle commented Apr 13, 2022

The goal is to make navigation around the codebase smoother for users, especially for keyboard-only users. This issue is currently my largest point of friction when using VSCode, which is why I think it's worth raising. Jumping to implementation, and jumping from implementation back to calls, are navigations I perform many times a day.

Here is an example: I am on the definition of the Logo component, and I want to see where this Logo component is used elsewhere in the codebase. So I invoke Go To References (Ctrl-click for some). But I get five results, when actually only two of them are useful to me. The default result is the least helpful, because it is the line I am already on!

Screenshot_20220414_050022

Note: The suggestions below are similarly relevant to Find All References, as they are to Go To References, and could be applied to both.

1. Do not list imports

Find All References and Go To References are very useful, but for me, they are not so useful when they list imports.

How many developers really want to see the import lines? I think most of the time we just want to get to one of the actual calls of the function (or uses of a variable).

When I last used WebStorm, it listed just the function calls, and not the imports. I wish VSCode would do the same.

Similarly, if the item is exported separately from its definition, I don't think we need to list the export line.

2. Also, do not list implementations

If I want to find the function definition/implementation, then I use Find All Implementations or Go To Implementations.

Therefore if I am using Go To References, that means I do not want to find the function implementation! That result is just noise that gets in the way.

This would also match WebStorm's behaviour. (Perhaps you are thinking, I should just use WebStorm! But I want to make VSCode as good as WebStorm...)

Motivation

I believe these suggestions would make it much easier for developers to jump around their codebase, and avoid interrupting their flow with forced interactions that are not useful to them.

This is especially true in the case where there is only one actual call made to the function, so the peek view would not even be needed, and the user could get straight to where they want to go.

New command

To preserve existing behaviour, which some people do use, the above suggestions should probably be a new command, for example Find All/Go To Uses or Find/Go To Immediate References. Then users can choose which command they want to use. Personally, I would bind this new behaviour to my keyboard shortcuts, and use the existing Go To References only rarely, probably from the command palette.

Previous requests

The suggestion to remove definitions from references has also been made in #68071 and #114673.

@mjbvz mjbvz added the feature-request Request for new features or functionality label Apr 13, 2022
@vscodenpa
Copy link

This feature request has not yet received the 20 community upvotes it takes to make to our backlog. 10 days to go. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@vscodenpa
Copy link

🙁 In the last 60 days, this feature request has received less than 20 community upvotes and we closed it. Still a big Thank You to you for taking the time to create this issue! To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@github-actions github-actions bot locked and limited conversation to collaborators Jul 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

5 participants
@joeytwiddle @jrieken @mjbvz @vscodenpa and others