0

In VSCode, whenever the Cmd key is down and I hover over a function definition, the editor automatically jumps to that definition. This incredibly annoying since I might press Cmd whenever I want to copy and paste some text, and then the editor will switch to another file.

Any idea how to disable this behaviour? All I can find is information about disabling Cmd+Click but nothing Cmd+Hover.

Edit:

This is an example of it. I press Cmd and move the cursor over the send keyword (in client.send) without clicking. This makes VSCode follow the link. And in that file the cursor ends up over another keyword which is then followed again, even though I didn't click on anything.

enter image description here

"edit.action.goto" commands

enter image description here

"go to" commands

enter image description here

enter image description here

10
  • Could you show a gif of what exactly you mean? I don't think hovering is supposed to cause actions like jumping to definition
    – Destroy666
    Commented May 30 at 20:08
  • I've just attached a video of it. I also don't think it should be doing this.
    – laurent
    Commented May 31 at 10:31
  • Show also a screenshot of all bindings for editor.action.goto search. Also check similar "Go to" ones if there's no weird keybind.
    – Destroy666
    Commented May 31 at 13:10
  • I've attached the bindings to the question although I'm not seeing anything obviously wrong here
    – laurent
    Commented Jun 3 at 7:48
  • Does this method disable this behavior? Note that this isn't supposed to happen without clicking on the function-name, so uninstalling VSCode and re-install might return it to the default behavior.
    – harrymc
    Commented Jun 3 at 9:29

1 Answer 1

0

The bug report Go To Source Definition feedback thread #49003 has this answer by the poster andrewbranch:

As of today’s VS Code Nightly, you can enable a setting that replaces Go To Definition with Go To Source Definition, allowing you to ctrl/⌘-click to trigger it. If source definitions cannot be retrieved, it falls back to Go To Definition. Since this addresses the only piece of feedback I’ve consistently received, I’m going to close this issue. Thanks everyone!

enter image description here

In other words, this sets the Source Definition to be the first attempt, with fallback to the type definition only if the source definition cannot be found.

Check to see if the setting of "TypeScript: Prefer Go To Source Definition" is indeed checked on your side, and if so then try to uncheck it.

1
  • This mentions regular Ctrl + click, not Ctrl + hover
    – Destroy666
    Commented Jun 6 at 15:48

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .