Skip to content

Conversation

@hahn-kev
Copy link
Contributor

@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
Contributor 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
Contributor 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
Contributor 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
Contributor 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
Contributor 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

@Karl255
Copy link

Karl255 commented Mar 17, 2025

Can this PR be finalized finally? It's been almost 3 years to get 1 commit into production to just add a checkbox and an additional condition...

@tbcarver
Copy link

tbcarver commented Jul 22, 2025

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.

You are so right that #3130 would be a much better fix for this feature. And at the same time so wrong because its been open for nearly a decade with no signs of being implemented, ever.

@vanyasem
Copy link

0.005% of all users

@hediet this has been preventing me from switching from JetBrains IDEs to VS Code for years. JetBrains IDEs are certainly not a niche, nor an unpopular product. Heck, Android Studio is based on JetBrains code.

While I usually advocate against "me too" comments on GitHub, pointing people to the "Thumbs up" button on the issue instead, I somewhat feel that your statement calls for as much spam as possible, to disprove the (completely unproven and baseless) "1000 users" theory

@ivanstepanovftw
Copy link

ivanstepanovftw commented Jul 23, 2025

Found a "solution" for Debian 13 trixie, GNOME Wayland. There is a program named Input Remapper, set this value for your mouse and/or touchpad: modify(Control_L, key(BTN_LEFT))
image

Edit: Sorry, it does not work reliably. I do not know why. Yesterday it works fine, and now it is broken.

Since VSCode input is bugged and based on polling, it is better to hold keys, like so:

hold_keys(Control_L, BTN_LEFT)

It does not work for Zed editor. I currently use this, which works on VSCode and Zed:

key_down(Control_L).wait(10).key(BTN_LEFT).wait(100).key_up(Control_L)

However Input Remapper means that you will not have X clipboard paste, close tabs in Firefox, etc.

@ivanstepanovftw
Copy link

@sandy081 Dear Microsoft Manager! I hope this message finds you well.
Can you, please, put this pull request and issue #3130 to the priority list? Kindly asking to do this because it will solve second most upvoted issue.

@herohiralal
Copy link

another month, another disappointing lack of an update

i don't understand what else this pr needs to be prioritised for the automatic tests

@astepforward
Copy link

astepforward commented Aug 27, 2025

Good afternoon. What's stopping the team from merging this highly anticipated PR?

Sincere, Alex

@hediet hediet modified the milestones: August 2025, September 2025 Sep 2, 2025
@acachy
Copy link

acachy commented Sep 5, 2025

There is no more important feature than this one
In last year or so

@hediet
Copy link
Member

hediet commented Sep 11, 2025

Implemented by #266044.

@hediet hediet closed this Sep 11, 2025
@vs-code-engineering vs-code-engineering bot locked and limited conversation to collaborators Oct 28, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.