Skip to content

align whitespace menu option with setting#306483

Merged
joshspicer merged 4 commits intomainfrom
josh/whitespace
Mar 31, 2026
Merged

align whitespace menu option with setting#306483
joshspicer merged 4 commits intomainfrom
josh/whitespace

Conversation

@joshspicer
Copy link
Copy Markdown
Member

@joshspicer joshspicer commented Mar 30, 2026

Addresses the misleading View → Appearance → Render Whitespace menu state by replacing the single toggle with a dedicated submenu that reflects the actual editor.renderWhitespace mode.

Changes Made

  • Introduces a new EditorRenderWhitespaceSubmenu menu id.
  • Reworks the Appearance menu entry into a "Render Whitespace" submenu with explicit modes (None/Boundary/Selection/Trailing/All).
  • Keeps the existing "Toggle Render Whitespace" command (F1) but removes it from the menubar Appearance menu.
  • Each mode command uses a descriptive title (e.g. "Set Render Whitespace to None") so it is unambiguous when surfaced in keyboard shortcuts settings, and a shortTitle (e.g. "None") for concise display.
  • Submenu placement (menu property) and toggle state (toggled) are declared directly in each Action2 descriptor, eliminating duplicate MenuRegistry.appendMenuItem calls. Only the submenu header registration remains as a separate MenuRegistry call.

Copilot AI review requested due to automatic review settings March 30, 2026 21:28
@joshspicer joshspicer changed the title align align whitespace menu option with setting Mar 30, 2026
Copy link
Copy Markdown
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

Addresses the misleading View → Appearance → Render Whitespace menu state by replacing the single toggle with a dedicated submenu that reflects the actual editor.renderWhitespace mode.

Changes:

  • Introduces a new EditorRenderWhitespaceSubmenu menu id.
  • Reworks the Appearance menu entry into a “Render Whitespace” submenu with explicit modes (None/Boundary/Selection/Trailing/All).
  • Keeps the existing “Toggle Render Whitespace” command (F1) but removes it from the menubar Appearance menu.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace.ts Adds mode-specific commands and registers a new menubar submenu to select the render whitespace mode.
src/vs/platform/actions/common/actions.ts Adds a new MenuId for the render-whitespace submenu.

…e MenuRegistry calls

Agent-Logs-Url: https://github.com/microsoft/vscode/sessions/68d6d9ff-b7a9-41b1-89f7-3c561b677802

Co-authored-by: joshspicer <23246594+joshspicer@users.noreply.github.com>
@joshspicer joshspicer enabled auto-merge (squash) March 31, 2026 01:33
@joshspicer joshspicer merged commit ea8cfb1 into main Mar 31, 2026
18 checks passed
@joshspicer joshspicer deleted the josh/whitespace branch March 31, 2026 02:25
@vs-code-engineering vs-code-engineering bot added this to the 1.115.0 milestone Mar 31, 2026
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.

4 participants