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

enable middle mouse button to open links and go to definition #154465

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

hahn-kev
Copy link

@hahn-kev hahn-kev commented Jul 8, 2022

This PR is related to #3130

Many times I have wanted to support middle mouse button to open links and go to definition, there's also numerous issues online about how to do this. This PR adds a option that's disabled by default that lets you middle click to go to definition or open a link.

This is my first PR for vscode, please let me know if you would prefer if I made this change in a different way. Also when I made some changes to editorOptions.ts that also caused some changes in standaloneEnums.ts and monaco.d.ts I've checked those in for this PR, let me know if they should be excluded.

@hahn-kev
Copy link
Author

@hediet not sure why the workflow didn't finish, is there something I can do to fix that?

@hediet
Copy link
Member

hediet commented Jul 14, 2022

Usually we first discuss such functionality in an isolated issue (that can be closed by the corresponding PR).

Without such an issue, we don't know what the demand is for this feature. Also, this is only a temporary solution until full mouse gesture customizations are supported.

Can you create/find the issue that this PR would fix? Thanks!

@hahn-kev
Copy link
Author

That makes sense, I would love it if we could customize all mouse options, but that seems quite complicated and this setting could easily be migrated once that's implemented.

For an issue specific to this PR there's #122649 but it looks like it was closed as a duplicate of an unrelated issue. Could we reopen it and discuss to find out interest in that issue? It is related to #3130 but since that original issue was closed right away it's hard to gauge interest.

As far as demand there's this comment on a similar issue, and this SO question.

I do understand not wanting to add more code and workarounds when a full gesture system would render that code obsolete. However I was hoping because of the minimal code change required that it would included.

@hediet
Copy link
Member

hediet commented Jul 18, 2022

I think the code looks good. But I'm not convinced more than 1000 users will enable this setting.

Given that we have ~20 million users, I'm reluctant to add this setting for just 0.005% of all users (especially when another 0.005% of all users want the middle click to do something else).

This fraction of users might be better of with #43794 (comment), especially when they want the middle mouse button to do something else.

@hahn-kev
Copy link
Author

That's a fair point. I'm not sure how good of a comparison this makes, but there is an extension for Visual Studio that implements this feature here, where you can see it has had over 7,000 installs, I'm not sure how the user numbers compare though. It also supports extra modifiers to invoke goto definition (like Ctrl+MMB) which broadens its appeal. I would be happy to implement that in this PR if you think it broadens the appeal of the feature, I'd just have to figure out how to present it to the user.

I'm not sure if it's worth mentioning, but this feature is supported in all Jetbrains IDEs. That is the main reason I want it here as I'm comfortable navigating my code using this shortcut and I miss the functionality.

@hediet
Copy link
Member

hediet commented Jul 18, 2022

Lets merge this when this PR gets enough attraction!

@hediet hediet added this to the On Deck milestone Jul 18, 2022
@choyzer
Copy link

choyzer commented Jul 20, 2022

Need it!!

@heartacker
Copy link
Contributor

@hahn-kev could you please make middle mouse button configratable and make it be goto defination by default

@hahn-kev
Copy link
Author

@heartacker Unfortunately it's not that simple, lots of people want to be able to configure mouse gestures, that's what this issue is for #3130

@ilwsm
Copy link

ilwsm commented Oct 12, 2022

I think the code looks good. But I'm not convinced more than 1000 users will enable this setting.

Given that we have ~20 million users, I'm reluctant to add this setting for just 0.005% of all users (especially when another 0.005% of all users want the middle click to do something else).

This fraction of users might be better of with #43794 (comment), especially when they want the middle mouse button to do something else.

This is bullshit
Where you get this digits: 0.005% , OMG!!
All jetbrain users uses middle click (go to definition).
There are also millions.
For example, I use JetBrain Clion, but recently moved to a weak computer, and I had to install vscode. There were two plugins with jetbrain key binding at once. But, for some reason, you are too lazy to implement a small optional code. Make a code of three lines of code as an option, my god. See how many are willing on SO, github and more.

@ilwsm
Copy link

ilwsm commented Oct 12, 2022

This is my first PR for vscode, please let me know if you would prefer if I made this change in a different way. Also when I made some changes to editorOptions.ts that also caused some changes in standaloneEnums.ts and monaco.d.ts I've checked those in for this PR, let me know if they should be excluded.

Please tell me, friend, what needs to be done to apply your PR?
Do i need to build Visual Code yourself with your changes, or can your PR be implemented as a plugin? I'm new to type script and I'm using a not-so-new IDE (1.70.3: This update is only available for Windows 7 users and is the last release supporting Windows 7.)
Do I have any chance?

@dnut
Copy link

dnut commented Oct 12, 2022

This is bullshit
Where you get this digits: 0.005% , OMG!!
All jetbrain users uses middle click (go to definition).
There are also millions.

I don't think aggression is warranted, but I do agree with the argument. In Jetbrains IDE's, this is not just an option, but the default. In a vanilla Intellij installation, middle click on any name, and it goes to definition/usage, unless you go into settings to disable it. At my prior job, we all used Intellij, and this was a widely used feature by my colleagues. Jetbrains defectors are a huge portion of the vscode user base. It's just much more convenient to click only the mouse, rather than having to press on both the mouse and the keyboard, especially when you're navigating through various files in the codebase, which already relies heavily on the mouse. So I would expect that most of the 10+ million jetbrains users who were exposed to this feature did actually use it. Go to definition/usage is one of the most widely used behaviors for any IDE, so it deserves first class status, at least as an option.

@hahn-kev
Copy link
Author

@GoodAndrewSoft

thanks for sharing your interest, I'd love to get better interest on this PR as it's ready to go so if you know other people who might show interest that would be great, I've shared it a bit but don't have many people to talk to about it.

As for getting it yourself you'd have to build it yourself, there's guides on how to do that but it's not simple, the version you're on isn't that old so you could probably checkout the version supporting windows 7 and cherry pick the commit in my PR to the older version and it should just work. The only real issue you might have is with extensions, I'm not sure if the extension marketplace works in custom builds, but you could still install them manually.

And sadly no you can't implement this with an extension, there's not a simple way to make this something that can be hooked into, if there was I would have done that instead.

Probably the best bet would be to implement #3130 as there's a ton of interest in that issue. I've thought about giving it a shot but I'm not sure how much work it would be.

@JelleBouma
Copy link

This was the feature that made me consider IntelliJ to be much easier to use effectively than Eclipse and Netbeans.
Thanks for taking steps to bring this functionality to Visual Studio and I really appreciate the link to the extension, it does exactly what I would want the program to do by default or option.

@ivanstepanovftw
Copy link

just 0.005% of all users

You will attract that much of JB's users, that will push that 0.005% up to 5% and lead to 999000 new users!

@ivanstepanovftw
Copy link

I don't see "go to definition" implementation. Only clickLinkGesture working.

@ivanstepanovftw

This comment was marked as resolved.

@ivanstepanovftw
Copy link

vscode dead?

@vivodi
Copy link

vivodi commented Dec 29, 2024

Is this still relevant?

@ivanstepanovftw
Copy link

1 more collaborator approval(s) required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.