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.
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
Code Actions - Add fix all support #6310
Code Actions - Add fix all support #6310
Changes from 4 commits
536e046
581506d
e5af714
2bd0b97
c29e0e0
2f68597
6fe55e7
8a99627
ee1eea2
7b7292d
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So I like the approach you took here, but it is slightly different from what we talked about before. I like this better anyway though, but we can simplify a little bit more.
Since you're directly applying the workspace edit (via
vscode.workspace.applyEdit
) and not returning a resolved code action to vscode, it would be better to have this implementation just be a command.Essentially:
roslyn.fixAll
) with arguments containing whatever flavor information you need to call back to the server as you do now. An example of where we do this is here - https://github.com/dotnet/roslyn/blob/main/src/Features/LanguageServer/Protocol/Handler/CodeLens/CodeLensHandler.cs#L149resolveCodeAction
middleware - you would move this implementation to a command handler. The implementation here basically wouldn't change (minus my other feedback). For example, where the client implements the command I linked above - https://github.com/dotnet/vscode-csharp/blob/main/src/lsptoolshost/unitTesting.ts#L21Then what happens is that when you select the fix all action in the list - the vscode LSP client will invoke our command handler (based on the command id we returned in the code action)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know it comes from Roslyn, but it is amusing that it is called FixAll"Flavors" and not "Scopes" or "Kinds".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
after you've finished addressing the other comments (e.g. moving to a command), can you make sure that if this fails it shows an error toast? if it doesn't we might need to explicitly show one.