8

I am running VS Code 1.52.1 in Windows, editing JavaScript code. I am a double-click, copy & paste junkie. I mouse over something, like a function name, with the intent to double click copy it to the clipboard. But sometimes VS Code wants to suggest a "Quick Fix". This would be OK with me, except that the Quick Fix is displayed in a popup that overlays the code I am attempting to copy. Depending on how fast I am working, I may not notice until I paste the "old" contents of the clipboard into my target location.

Take the following function, for example.

// function to allow a promise-oriented caller to invoke
// a callback-oriented function
function callbackToPromise( resolve, reject ) {
    return function done( err, data ) {
        if(err) {
            reject(err);
        }
        else {
            resolve(data);
        }
    }
}

I mouse over the function name and the Quick Fix appears, overlaying the line of code where the mouse is hovering. The fix itself is redacted to avoid irrelevant discussion.

enter image description here

This behavior is both inconvenient and annoying, as it shifts my focus from the code to the misbehaving tool. It's like stubbing my toe a dozen times a day.

How can I configure VS Code not to automatically display Quick Fix popups? I would much prefer if VS Code would simply underline the function name and let me press the hotkey to see the popup.

2
  • 1
    I feel like the "Quick Fix" has moved position. I don't think it was always positioned right under the mouse, it's a pretty annoying default. Commented Feb 4, 2021 at 17:39
  • @limitlessloop pretty annoying to say the least! Commented Feb 25, 2021 at 22:08

2 Answers 2

11

I'm not aware of an exact/direct setting for the Quick Fix suggestion. What you can do though is to control the entire popup: increase the delay or disable it on mouse hover, then use shortcut keys to show it only when you want it to.

The settings for the mouse hover are editor.hover.*:

settings for editor.hover

"editor.hover.delay": 300,
"editor.hover.enabled": true,
"editor.hover.sticky": true,

Set editor.hover.delay to some "high" value, so it gives you time to double-click to copy things before the popup appears. Or, disable it entirely with editor.hover.enabled.

As for the hotkeys, in Keyboard Shortcuts, there's editor.action.showHover:

keyboard shortcut showHover

You can disable the popup on mouse hover with editor.hover.enabled set to false, and then just use the shortcut key to show it manually (I'm using a Mac so it's showing Mac shortcut keys. There should also be one for Windows.)

From the popup, there's also a shortcut key for directly showing the Quick Fix suggestions. You can also configure that from Keyboard Shortcuts as editor.action.quickFix:

keyboard shortcut quick fix

Again, you can disable the popup on mouse hover with editor.hover.enabled set to false and then just use the Quick Fix shortcut key to show it as needed.

1
  • The hover delay is the perfect solution for me. Thanks for the thorough answer. Commented Jan 14, 2021 at 22:15
1

In Windows 10 this is how I did it: Settings -> Text Editor -> Quick Suggestions Delay.

Quick Fix Delay

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.