Cascade code actions on save by provider - #328186
Open
Vivek JM (vivekjm) wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Cascades editor code actions on save so each provider sees prior edits.
Changes:
- Adds provider-specific code-action querying.
- Applies save actions sequentially by provider.
- Adds a regression test for import corruption.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
codeAction.ts |
Adds optional provider filtering. |
saveParticipants.ts |
Serializes providers during editor saves. |
saveParticipant.test.ts |
Tests cascading import organizers. |
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.
Fixes #174295
Code action providers used for save participants were queried concurrently against the same document version, but their edits were then applied sequentially. When multiple import organizers returned edits, the later provider could apply stale offsets and duplicate or corrupt imports.
This queries and applies providers sequentially in the registry's deterministic order. Each provider therefore sees the document after the preceding provider's edits, while action ordering within a provider remains unchanged.
Tests run:
npm run typecheck-clientnpm run gulp compile(0 errors)