Add dynamic codefix expansion support#11191
Draft
haiyuazhang wants to merge 6 commits into
Draft
Conversation
Extends the CodeFix interface with an optional resolveCodefixes() method that allows a single codefix to expand into multiple labeled options at Ctrl+. time. This enables AI-powered codefixes where the labels are determined asynchronously (e.g., via vscode.lm through the existing custom/chatCompletion LSP bridge). Changes: - types.ts: Add resolveCodefixes to CodeFix interface - serverlib.ts: Modify getCodeActions to resolve and cache dynamic codefixes - Promise-based cache prevents duplicate AI calls from concurrent requests - Separate resolvedCodefixMap for resolveCodeAction lookup - Both caches cleared on recompilation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Verify resolveCodefixes expands one diagnostic fix into multiple code actions and resolves the selected dynamic fix. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
|
All changed packages have been documented.
Show changes
|
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
commit: |
|
You can try these changes here
|
Ignore the standard suppress-warning quick fix and assert only dynamically resolved suggestions. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Adds an optional
resolveCodefixeshook toCodeFixso one diagnostic fix can expand into multiple quick-fix entries when code actions are requested.This supports editor-only dynamic suggestions, such as AI-generated rename options through the existing VS Code
custom/chatCompletionbridge.Includes a server test for expanding dynamic fixes and resolving the selected generated fix.
Local note: focused test could not be run locally because dependency install failed on a private package feed auth error; CI should validate.