Expand hover setting to allow for key modifier mode#274001
Expand hover setting to allow for key modifier mode#274001benvillalobos merged 18 commits intomicrosoft:mainfrom
Conversation
…going to the other setting
There was a problem hiding this comment.
Pull Request Overview
This PR converts the editor.hover.enabled setting from a boolean type to a string enumeration with three possible values: 'on', 'off', and 'onKeyboardModifier'. The new 'onKeyboardModifier' option enables conditional hover behavior based on keyboard modifier keys, allowing hover to be shown when the opposite modifier key from the multi-cursor modifier is pressed.
Key Changes:
- Changed
IEditorHoverOptions.enabledtype frombooleanto'on' | 'off' | 'onKeyboardModifier' - Added backward compatibility logic to convert boolean values to the new string format
- Introduced
shouldShowHover()utility function to determine hover visibility based on modifier keys - Updated all usages throughout the codebase to use the new string values
Reviewed Changes
Copilot reviewed 9 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
src/vs/editor/common/config/editorOptions.ts |
Updated IEditorHoverOptions.enabled type definition, default value, schema configuration with enum descriptions, and added backward compatibility conversion |
src/vs/monaco.d.ts |
Updated public API type definition for IEditorHoverOptions.enabled |
src/vs/editor/contrib/hover/browser/hoverUtils.ts |
Added new shouldShowHover() utility function with documentation to determine hover visibility |
src/vs/editor/contrib/hover/browser/contentHoverController.ts |
Integrated shouldShowHover() logic and updated enabled checks from boolean to string comparison |
src/vs/editor/contrib/hover/browser/glyphHoverController.ts |
Integrated shouldShowHover() logic and updated enabled checks from boolean to string comparison |
src/vs/workbench/contrib/debug/browser/debugEditorContribution.ts |
Updated hover enabled checks to use string values ('off', 'on') instead of boolean |
src/vs/workbench/contrib/interactive/browser/interactiveEditor.ts |
Changed hover enabled initialization from true to 'on' |
src/vs/workbench/contrib/replNotebook/browser/replEditor.ts |
Changed hover enabled initialization from true to 'on' |
src/vs/editor/test/browser/config/editorConfiguration.test.ts |
Updated test to use new string values ('on', 'off') instead of boolean |
src/vs/editor/contrib/hover/test/browser/hoverUtils.test.ts |
Added comprehensive test suite for the new shouldShowHover() function |
There was a problem hiding this comment.
LGTM. I left a couple of minor comments about how to better migrate and about the description.
@aiday-mar please also review
|
This looks good! One thing I noticed though is that when the setting is |
|
@aiday-mar Merging this as-is so the reviews are scoped. I've filed #276558 and will tackle it this milestone |
…nal-tooltips-markdown * 'main' of https://github.com/microsoft/vscode: (56 commits) edits: show diff for sensitive edit confirmations (microsoft#276620) Enable Back button on the Manage Accounts picker (microsoft#276622) Ignore obsolete chat content parts when loading persisted session (microsoft#276615) settings cleanup (microsoft#276602) Remove unused `args: any` parameter Terminal suggest - include persistent options in suggestions and improve suggestion grouping (microsoft#276409) fix selections not being added (microsoft#276600) Embed AI search into the existing search view message (microsoft#276586) Cleanup some eslint exemptions (microsoft#276581) fix microsoft#276579 (microsoft#276590) SCM - cleanup some more eslint rules (microsoft#276571) Bump gpu types and skip lib check for gpu typing issue Fix in smoke tests Remove `forChatSessionTypeAndId` Fix one more import detect `press any/a key` and ask if user wants to send `a` to terminal (microsoft#276554) Filter subagent and todo tools from subagent requests (microsoft#276553) Expand hover setting to allow for key modifier mode (microsoft#274001) Allow partial monacoEnvironment.getWorker/getWorkerUrl Update imports ...
Fixes #72025
Changes Made
hover.enabledsetting from a boolean to an enum with values [on,off,onKeyboardModifier]inlayHints.enabledwent from boolean to enumonKeyboardModifier, hover only appears whenctrl,cmd, oraltare held down.Multi Cursor Modifier. If MCM is set toctrlCmd, hover triggers onaltand vice versa.multi-cursor.mp4
To Test
Hover: EnabledtoonKeyboardModifierMulti Cursor ModifierMulti Cursor Modifieris held downctrlCmd, hover should only show whenaltis held down.alt, hover should show when eitherctrlorcmd(macOS) are held down.Multi Cursor Modifierto whatever it is not currentlyHover: Enabledonandoffwork as expected