Skip to content

Add editor.hover.showLongLineWarning setting to suppress long line hovers#298484

Merged
alexdima merged 1 commit intomainfrom
alexd/autonomous-felidae
Feb 28, 2026
Merged

Add editor.hover.showLongLineWarning setting to suppress long line hovers#298484
alexdima merged 1 commit intomainfrom
alexd/autonomous-felidae

Conversation

@alexdima
Copy link
Member

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

…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
Copilot AI review requested due to automatic review settings February 28, 2026 20:02
@alexdima alexdima enabled auto-merge (squash) February 28, 2026 20:02
@alexdima alexdima self-assigned this Feb 28, 2026
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 showLongLineWarning option added to IEditorHoverOptions in both editorOptions.ts and monaco.d.ts, with full validation and settings registration.
  • New HIDE_LONG_LINE_WARNING_HOVER_ACTION_ID command registered in hoverContribution.ts that writes false to the setting, and the long-line warning hovers in markdownHoverParticipant.ts now 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: true allows 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:200 and src/vs/workbench/contrib/mcp/browser/mcpServersView.ts:278 both use isTrusted: { 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

Comment on lines +39 to +40
CommandsRegistry.registerCommand(HIDE_LONG_LINE_WARNING_HOVER_ACTION_ID, (accessor) => {
accessor.get(IConfigurationService).updateValue('editor.hover.showLongLineWarning', false);
Copy link

Copilot AI Feb 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
@alexdima alexdima merged commit c3e0638 into main Feb 28, 2026
24 checks passed
@alexdima alexdima deleted the alexd/autonomous-felidae branch February 28, 2026 20:18
DonJayamanne pushed a commit that referenced this pull request Mar 2, 2026
…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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Option to turn off TOKENIZATION IS SKIPPED ... hover message WITHOUT turning off hovers altogether.

3 participants