Skip to content

Fix unreliable code fix application by switching to codeAction/resolve #10618

Merged
timotheeguerin merged 2 commits into
microsoft:mainfrom
timotheeguerin:fix/better-code-fix-trigger
May 7, 2026
Merged

Fix unreliable code fix application by switching to codeAction/resolve #10618
timotheeguerin merged 2 commits into
microsoft:mainfrom
timotheeguerin:fix/better-code-fix-trigger

Conversation

@timotheeguerin
Copy link
Copy Markdown
Member

@timotheeguerin timotheeguerin commented May 7, 2026

Fixes #3389

Code fixes would silently fail when a recompilation completed between the user seeing a fix and clicking it, because the diagnostic index was cleared on each compile.

This switches from the legacy command-based flow (executeCommand) to the LSP codeAction/resolve pattern edits are resolved at interaction time and embedded directly in the CodeAction, eliminating the race with recompilation. The diagnostic index is also now swapped atomically instead of being cleared eagerly.

@microsoft-github-policy-service microsoft-github-policy-service Bot added the compiler:core Issues for @typespec/compiler label May 7, 2026
@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented May 7, 2026

Open in StackBlitz

npm i https://pkg.pr.new/@typespec/compiler@10618

commit: 198f52a

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 7, 2026

All changed packages have been documented.

  • @typespec/compiler
Show changes

@typespec/compiler - fix ✏️

[LSP] Fix code fixes often not running when selected

@azure-sdk
Copy link
Copy Markdown
Collaborator

azure-sdk commented May 7, 2026

You can try these changes here

🛝 Playground 🌐 Website 🛝 VSCode Extension

@timotheeguerin timotheeguerin changed the title Try use code fix resolver to improve code fix trigger reliability Use code fix resolver to improve code fix trigger reliability May 7, 2026
@timotheeguerin timotheeguerin changed the title Use code fix resolver to improve code fix trigger reliability Fix unreliable code fix application by switching to codeAction/resolve May 7, 2026
@timotheeguerin timotheeguerin marked this pull request as ready for review May 7, 2026 12:08
@timotheeguerin timotheeguerin added this pull request to the merge queue May 7, 2026
Merged via the queue into microsoft:main with commit 24eeefa May 7, 2026
31 checks passed
@timotheeguerin timotheeguerin deleted the fix/better-code-fix-trigger branch May 7, 2026 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

compiler:core Issues for @typespec/compiler

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Applying codefixes can still be unreliable

3 participants