How to restore previous behavior of editor.action.showDefinitionPreviewHover in VS Code? - Stack Overflow

admin2025-04-18  2

After updating to a recent version of VS Code (post-1.80), the behavior of the editor.action.showDefinitionPreviewHover command has changed. Previously, when using this command (bound to gh in my case), the definition preview would appear and could be dismissed by simply moving the cursor or pressing any key. Now, the preview opens in a "sticky" mode, and the only way to close it is by pressing Escape. This is disruptive to my workflow.

Steps to Reproduce

  1. Bind a key (e.g., gh) to the editor.action.showDefinitionPreviewHover command.
  2. Place the cursor on a symbol (e.g., a function or variable).
  3. Press the key (gh) to trigger the definition preview.
  4. Observe that the preview opens in a sticky mode and cannot be dismissed without pressing Escape.

Expected Behavior

The definition preview should close automatically when moving the cursor or pressing any key, as it did in previous versions.

Current Behavior

The definition preview remains open until Escape is pressed, which is less convenient.


I tried searching through recent release notes but found nothing. It looks like it's a new feature but not sure how to change this behavior.

Thanks in advance!

转载请注明原文地址:http://anycun.com/QandA/1744964335a90118.html