Skip to content

Honor explicit inline edit gutter menu visibility - #339575

Merged
Dmitriy Vasyura (dmitrivMS) merged 6 commits into
microsoft:mainfrom
minwookshin:fix/monaco-inline-edit-menu
Nov 6, 2026
Merged

Dmitriy Vasyura (dmitrivMS) merged 6 commits into
microsoft:mainfrom
minwookshin:fix/monaco-inline-edit-menu

Conversation

@minwookshin

@minwookshin Minwook Shin (minwookshin) commented Oct 4, 2026 •

Copy link
Copy Markdown
Contributor

Fixes microsoft/monaco-editor#5227.

Honor an explicit showInlineEditMenu: false for inline edits while preserving the existing default. The view reads the tri-state preference through a model getter. The preference also applies to gutter hover and the offscreen preview without hiding the preview itself.

Regression tests cover false, true and omitted values, disabled-menu hover, and the long-distance preview. The false cases fail before the fix. Tests wait for the provider's shown callback before disposing the model.

After merging main e03227f6 on November 6, all 164 inline-completion Electron tests pass (one existing skipped test), as do 10 targeted tests in each of Chromium, Firefox and WebKit. Client typecheck, ESLint and hygiene pass. To verify manually, run the issue's provider example and hover the gutter with showInlineEditMenu set to false, true and omitted.

Copilot AI balanced review requested due to automatic review settings October 4, 2026 09:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot review overview

🟢 Approval recommended

The behavior is correct and covered, with only a non-blocking model encapsulation concern.

Review effort: Balanced
Findings: 1 Low severity

Open (1)
What changed in this PR

Honors explicit suppression of the inline-edit gutter menu while retaining default visibility.

Changes:

  • Hides the gutter indicator when showInlineEditMenu is false.
  • Adds coverage for false, true, and omitted values.
File Description
inlineSuggestionsView.ts Applies menu visibility preference.
inlineEdits.test.ts Tests gutter rendering behavior.

💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@minwookshin

Copy link
Copy Markdown
Contributor Author

The fork workflow approval expired before any jobs ran (CI run). Could a maintainer help start fresh CI?

auto-merge was automatically disabled November 4, 2026 18:10

Pull request was closed

@dmitrivMS

Copy link
Copy Markdown
Collaborator

Unit-tests are failing:

 Inline Edits
    ✔ inline edit gutter menu: true (98ms)
[3987:1105/084158.046268:INFO:CONSOLE:227] "Error: Test run should not have unexpected errors:
Model is disposed!
Error: Model is disposed!
    at TestTextModel._assertNotDisposed (file:///home/runner/work/vscode/vscode/out/vs/editor/common/model/textModel.js:335:13)
    at TestTextModel.getValue (file:///home/runner/work/vscode/vscode/out/vs/editor/common/model/textModel.js:620:10)
    at computeSingleEditKind (file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/model/editKind.js:97:33)
    at file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/model/editKind.js:60:70
    at Array.map (<anonymous>)
    at computeEditKind (file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/model/editKind.js:60:57)
    at InlineEditItem.computeEditKind (file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js:472:12)
    at InlineEditItem.reportInlineEditShown (file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js:124:91)
    at InlineCompletionsModel.handleInlineSuggestionShown (file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js:982:28)
    at Object.callback (file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js:22:19)
    at file:///home/runner/work/vscode/vscode/out/vs/base/common/platform.js:145:23", source: file:///home/runner/work/vscode/vscode/test/unit/electron/renderer.js (227)
    1) inline edit gutter menu: true
    ✔ inline edit gutter menu: undefined
[3987:1105/084158.071950:INFO:CONSOLE:227] "Error: Test run should not have unexpected errors:
Model is disposed!
Error: Model is disposed!
    at TestTextModel._assertNotDisposed (file:///home/runner/work/vscode/vscode/out/vs/editor/common/model/textModel.js:335:13)
    at TestTextModel.getValue (file:///home/runner/work/vscode/vscode/out/vs/editor/common/model/textModel.js:620:10)
    at computeSingleEditKind (file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/model/editKind.js:97:33)
    at file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/model/editKind.js:60:70
    at Array.map (<anonymous>)
    at computeEditKind (file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/model/editKind.js:60:57)
    at InlineEditItem.computeEditKind (file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js:472:12)
    at InlineEditItem.reportInlineEditShown (file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/model/inlineSuggestionItem.js:124:91)
    at InlineCompletionsModel.handleInlineSuggestionShown (file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/model/inlineCompletionsModel.js:982:28)
    at Object.callback (file:///home/runner/work/vscode/vscode/out/vs/editor/contrib/inlineCompletions/browser/view/inlineEdits/inlineEditsModel.js:22:19)
    at file:///home/runner/work/vscode/vscode/out/vs/base/common/platform.js:145:23", source: file:///home/runner/work/vscode/vscode/test/unit/electron/renderer.js (227)
    2) inline edit gutter menu: undefined

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Unit-test failures

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Disabling the inline edit menu can cause a hover-triggered crash and still leaves the menu accessible in offscreen previews.

2 open issues
1 resolved since last review

Review effort: Max

@minwookshin

Copy link
Copy Markdown
Contributor Author

Fixed the teardown race by waiting for the provider's shown callback before disposing the model. Also covered the disabled-menu hover and offscreen preview cases. After merging current main, 164 Electron tests and 30 targeted browser cases pass, along with typecheck, lint and hygiene. The fresh CI run is awaiting approval.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The tests bypass provider-preference forwarding, so they would still pass if that forwarding were removed and the provider’s false setting were ignored.

2 open issues
1 resolved since last review

Review effort: Max

@dmitrivMS
Dmitriy Vasyura (dmitrivMS) merged commit e561c04 into microsoft:main Nov 6, 2026
52 checks passed
@vs-code-engineering vs-code-engineering Bot added this to the 1.146.0 milestone Nov 6, 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.

[Bug] Cannot hide inline edit menu by setting showInlineEditMenu to false

10 participants