-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Proposal: 'Fix All In File' for CodeFixes #14549
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
Comments
Perhaps related to #19255. |
Hey @Andy-MS, is this new API exposed in |
The API is now public (#21234). |
Thanks @Andy-MS! Question on testing: we should now see a |
Try again with #21247 |
Ok, working now. Will try to get initial vs code support for this in today |
Uh oh!
There was an error while loading. Please reload this page.
From microsoft/vscode#22220
Problem
The current TypeScript code fixes must be applied individual. For fixes such as
remove unused import
, we would also like to support applying the fix to across all effected locations in a file.Possible Approaches
To support this scenario across various editors and tools, the best approach would have the TSServer itself return
Fix all in File
type code fixes whengetCodeFixes
is requested. No TSServer API/protocol would have to be updated to support this. My only concern is that calculating the edits for fixing all problem in a file may be expensive and could bog down the TSServer.The alternative would be to implement the
fix all in file
logic in VSCode. To do this, we would make multiple calls togetCodeFixes
against the TSServer to build up a set offix all in file
code actions. Each type ofCodeAction
returned by TSServer would need a kind identifier so that we can bundle all instances of the same kind together. We would also need to know which types of code fixes can be applied across an entire file@mhegazy and anyone else, please let me know if you have any thoughts on this
The text was updated successfully, but these errors were encountered: