Fix delayed code action commands with arguments - #333295
Merged
Dmitriy Vasyura (dmitrivMS) merged 2 commits intoAug 29, 2026
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Dmitriy Vasyura (dmitrivMS)
enabled auto-merge (squash)
August 29, 2026 00:46
Copilot started reviewing on behalf of
Dmitriy Vasyura (dmitrivMS)
August 29, 2026 00:47
View session
Contributor
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: 2
New issues introduced by this change (2)
| Severity | Finding |
|---|---|
src/vs/editor/contrib/codeAction/browser/codeActionModel.ts — A canceled request can still reach _setCodeActions after its provider eventually resolves. If it… |
|
src/vs/editor/contrib/codeAction/test/browser/codeActionModel.test.ts — This test enables nearby quick fixes, but Default does not satisfy the nearby-actions gate… |
What changed in this PR
Fixes code-action lifetime handling so delayed Quick Fix commands retain their arguments.
Changes:
- Transfers resolved action ownership to the controller.
- Disposes unclaimed or canceled action results.
- Adds regression coverage for overlapping requests.
| File | Description |
|---|---|
codeActionModel.ts |
Adds explicit ownership transfer and disposal. |
codeActionController.ts |
Claims and manages resolved actions. |
codeActionModel.test.ts |
Tests cancellation-related lifetime behavior. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot started reviewing on behalf of
Dmitriy Vasyura (dmitrivMS)
August 29, 2026 01:51
View session
Vijay Upadya (vijayupadya)
approved these changes
Aug 29, 2026
Dmitriy Vasyura (dmitrivMS)
deleted the
dmitriv/fix-code-action-command-arguments
branch
August 29, 2026 01:56
Contributor
There was a problem hiding this comment.
Copilot review overview
Review tier: Balanced
Findings: None
Issues resolved since last review (2)
| Severity | Finding |
|---|---|
src/vs/editor/contrib/codeAction/test/browser/codeActionModel.test.ts — This test enables nearby quick fixes, but Default does not satisfy the nearby-actions gate… View resolved comment |
|
src/vs/editor/contrib/codeAction/browser/codeActionModel.ts — A canceled request can still reach _setCodeActions after its provider eventually resolves. If it… View resolved comment |
Suppressed comments (1)
Previously missed (1) — in code that hasn't changed since the last review.
src/vs/editor/contrib/codeAction/browser/codeActionController.ts:215
- After this claim, the model no longer owns the set, so
CodeActionModel._update()cannot dispose it when the editor model is cleared. The controller'sEmptybranch only hides the lightbulb and_activeCodeActionskeeps the previous model's provider result (including extension-host command payloads) until another result arrives or the controller itself is destroyed. Please release the claimed set on model/state teardown while still preserving it for any currently open action widget.
actions = this._model.takeCodeActions(await newState.actions);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Fixes #331834.
This regressed in #330142, which made the reusable code-action disposable holder active again but allowed a later result to dispose the action set still backing an open Quick Fix menu.
Validation
scripts\test.bat --run src\vs\editor\contrib\codeAction\test\browser\codeActionModel.test.ts(7 passing)Actual command not foundnotification