-
Notifications
You must be signed in to change notification settings - Fork 29.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Let code actions highlight a range of code they apply to #199608
Labels
api
api-proposal
editor-code-actions
Editor inplace actions (Ctrl + .)
insiders-released
Patch has been released in VS Code Insiders
on-testplan
Milestone
Comments
/cc @MariaSolOs |
I like this actually (so it'll be kind of similar to the nearby quick fixes menu which highlights when not on specific code). some smol thoughts related to the ui:
highlights needs to explore:
|
Also, please consider provide a way to highlight the added code like: https://github.com/p42ai/js-assistant 2024-01-06.10.58.18.mov |
shape of the API atm: declare module 'vscode' {
export interface CodeAction {
/**
*
* The range to which this Code Action applies to, which will be highlighted.
*
* Ex: A refactoring action will highlight the range of text that will be affected.
*/
ranges?: Range[];
}
} |
could something similar be added to |
vscodenpa
added
unreleased
Patch has not yet been released in VS Code Insiders
insiders-released
Patch has been released in VS Code Insiders
and removed
unreleased
Patch has not yet been released in VS Code Insiders
labels
Jan 18, 2024
3 tasks
This was referenced Feb 1, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Labels
api
api-proposal
editor-code-actions
Editor inplace actions (Ctrl + .)
insiders-released
Patch has been released in VS Code Insiders
on-testplan
Problem
For refactoring such as
extract method
ormove to file
, it's not always clear which code the action will apply to. This is especially true for languages like TS that try to intelligently expand the user's current selectionProposal
Let code actions provide one (or potentially many) ranges that they will apply to. This range can then be highlighted as the user arrows through the code action list
For refactorings, this range would be the code in the current file that will be effected by the refactoring
For quick fixes, this range could be the range of the diagnostics that will be fixed (or we could just highlight the diagnostics directly since code actions already provide this info in
CodeAction.diagnostics
)The text was updated successfully, but these errors were encountered: