vscode-csharp icon indicating copy to clipboard operation
vscode-csharp copied to clipboard

Apply all available code fixes in the document

Open amylnikau opened this issue 10 months ago • 1 comments

I didn't found a way to fix all issues reported by code analyzers using one VS Code command. At the moment you need to manually navigate to each issue in the document, open "Quick Fix" menu and select the fix from there.

It would be great to add a new feature flag or add support for editor.action.fixAll command. This extension would iterate over all issues of the open document and apply a default fix if it's available. Similar to how dotnet format analyzers command work. Honestly, I don't know how easy it can be implemented but I got used to such functionality in Rider(C#)\VS Code(typescript,javascript) and I think it really improves dev experience.

Current behavior: Image Image

P.S. Suggested 'Fix all' command is different from the one implemented in https://github.com/dotnet/vscode-csharp/pull/6310. so you can fix all occurences of a single issue, not all occurences of all issues in the document

amylnikau avatar Feb 05 '25 23:02 amylnikau

I believe this would also make is possible to fix all on save, using editor.codeActionsOnSave.

act185947 avatar Feb 09 '25 12:02 act185947