-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
Feature Request: open Peek References when Ctrl-click is on the symbol in its declaration #73081
Comments
Translating the above in terms of providers:
|
We find this feature very confusing. Can we have a conversation about it before it ships in stable? C++ find all references is (potentially) very expensive to compute and it's counter-intuitive to invoke feature B when you ask for feature A. Can you expose the ability to invoke find all references via goto definition some other way? I think a lot of people are going to be confused by this behavior. |
Well, users have asked for it and it's when other editors, like IntelliJ, do. For instance, this is a nice comparison from the perspective of a power user: https://gist.github.com/joeytwiddle/49ecf347bf97c5a67a8d713dd437efcf#go-to-defintionreferences
I am unsure if you say this as a user or as the owner of a slow references provider? For C++ or for slow providers in general I feel it needs some way to allow them to express that they are slow. TBH even today peek references doesn't work well for slow providers and either per provider or per request a way to say "this will take a while" might be needed. In that case the UX can adapt and for instance not offer such rapid code navigation features. |
Sure, we can always add a way to enable/disable this and in fact insiders is the vehicle to collect such feedback. Yours and your team's feedback has now been noted and see what else comes in. Note that we have also received positive feedback. Still, adding a new feature and disabling it by default is almost like not adding a new feature and assuming we have a setting to control, it will likely be on by default. |
Again, I'm not trying to contest that this feature is bad or confusing for everyone. I don't think we have enough data at this point to make a call about the majority opinion though (and maybe we won't until after it ships in stable). I suggested an alternate implementation that has zero chance of confusion but I didn't hear your thoughts on that proposal. If the goal is quick access to additional language server commands, then making those commands easily available in the hover UI would address that need without introducing confusion for users who have been using F12 for years. |
I did ping you on a partner issue where this was already suggested. In fact Java is doing something very similar already today and we could make it a thing. Having said that, I don't think they are mutually exclusive - I actually want both |
Seems that in JavaScript files, imports with a proper definition (from source file or .d.ts) are considered as "references", but ones without are "declarations". So now when I press F12 on those imports, some of them will jump to their declarations but others will peek all references. It's super confusing and super annoying and I consider this as a bug. |
is there a way to turn off this feature please ? this gives pretty horrible experience with C/C++ |
Yeah, we would like some way we could disable it for our C/C++ extension. |
I'm wondering, why do you guys ever |
@inliquid Users might not notice they're at the definition already (i.e. they may mistake the code for a C++ declaration or vice versa) or they might expect to go to the declaration instead. Maybe users will stop doing that once they realize it invokes Find All References? |
We can think about adding a setting which defines the fallback command, e.g. goto declaration for cpp from definitions or simply nothing |
fyi - I have pushed a commit that adds settings like |
Thanks @jrieken! |
Initially this issue was opened in vscode-go extension repo: microsoft/vscode-go#2451
Maintainer (@ramya-rao-a) asked to reopen it here.
By default, with
Ctrl-click
you go to symbol definition, f.e. to a function declaration. When you makeCtrl-click
on a declared name, VS Code in fact does nothing, which seems counter-intuitive. In most of the cases I need toShift-F12
to see the usages of that symbol or if I want to go back from that place after some navigation happened around that symbol.I think it would be very useful, if when you
Ctrl-click
on a function, variable, or a type name in a place where the symbol is defined,VS Code
will open a Peek References of that symbol. This would be close to what Goland does by default and what I personally found extremely helpful.The text was updated successfully, but these errors were encountered: