Add editor.hover.showLongLineWarning setting to suppress long line hovers#298484
Add editor.hover.showLongLineWarning setting to suppress long line hovers#298484
Conversation
…vers Add a new setting `editor.hover.showLongLineWarning` (default: true) that controls whether the "Tokenization is skipped..." and "Rendering paused..." hover messages are shown on long lines. When these hovers are shown, they now include a "Don'\''t Show Again" link that sets the setting to false, letting users dismiss them permanently while keeping all other hover functionality intact. Fixes #172713
There was a problem hiding this comment.
Pull request overview
This PR adds a new editor.hover.showLongLineWarning setting (default: true) that lets users permanently suppress the "Tokenization is skipped..." and "Rendering paused..." hover warnings shown on long lines. It also adds a "Don't Show Again" link directly in those hover messages that sets the new setting to false.
Changes:
- New
showLongLineWarningoption added toIEditorHoverOptionsin botheditorOptions.tsandmonaco.d.ts, with full validation and settings registration. - New
HIDE_LONG_LINE_WARNING_HOVER_ACTION_IDcommand registered inhoverContribution.tsthat writesfalseto the setting, and the long-line warning hovers inmarkdownHoverParticipant.tsnow conditionally show based on the setting and include the "Don't Show Again" link.
Reviewed changes
Copilot reviewed 4 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
src/vs/editor/common/config/editorOptions.ts |
Adds showLongLineWarning to IEditorHoverOptions, its default, schema entry, and validation |
src/vs/monaco.d.ts |
Exposes the new showLongLineWarning option in the public Monaco API |
src/vs/editor/contrib/hover/browser/hoverActionIds.ts |
Declares the new HIDE_LONG_LINE_WARNING_HOVER_ACTION_ID constant |
src/vs/editor/contrib/hover/browser/hoverContribution.ts |
Registers the command that sets showLongLineWarning to false |
src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts |
Guards long-line warning hovers behind the new setting and adds "Don't Show Again" links |
Comments suppressed due to low confidence (1)
src/vs/editor/contrib/hover/browser/markdownHoverParticipant.ts:141
- Using
isTrusted: trueallows any command to be executed from markdown links. The codebase consistently uses{ enabledCommands: [...] }to restrict which specific commands can be triggered. For example,src/vs/workbench/contrib/chat/browser/chatSlashCommands.ts:200andsrc/vs/workbench/contrib/mcp/browser/mcpServersView.ts:278both useisTrusted: { enabledCommands: ['workbench.action.openSettings'] }.
You should use isTrusted: { enabledCommands: [HIDE_LONG_LINE_WARNING_HOVER_ACTION_ID] } instead of isTrusted: true to restrict command execution to only this specific action.
isTrusted: true
| CommandsRegistry.registerCommand(HIDE_LONG_LINE_WARNING_HOVER_ACTION_ID, (accessor) => { | ||
| accessor.get(IConfigurationService).updateValue('editor.hover.showLongLineWarning', false); |
There was a problem hiding this comment.
The updateValue call does not specify a ConfigurationTarget, meaning the setting may be written to wherever the setting is currently defined (workspace, workspace folder, etc.) rather than always to user-level global settings. For a "Don't Show Again" action, the intent is to persist the preference in the user's global settings.
Similar patterns in the codebase (e.g., unicodeHighlighter.ts lines 597, 620, 644, 668, 692) explicitly pass ConfigurationTarget.USER to ensure the setting is always written to the user's global settings file. You should add ConfigurationTarget.USER as the third argument here to match this pattern and guarantee the correct target.
…vers (#298484) Add a new setting `editor.hover.showLongLineWarning` (default: true) that controls whether the "Tokenization is skipped..." and "Rendering paused..." hover messages are shown on long lines. When these hovers are shown, they now include a "Don'\''t Show Again" link that sets the setting to false, letting users dismiss them permanently while keeping all other hover functionality intact. Fixes #172713
Add a new setting
editor.hover.showLongLineWarning(default: true) that controls whether the "Tokenization is skipped..." and "Rendering paused..." hover messages are shown on long lines.When these hovers are shown, they now include a "Don'''t Show Again" link that sets the setting to false, letting users dismiss them permanently while keeping all other hover functionality intact.
Fixes #172713