Skip to content
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

Switches the 'Fix all' quick fix provider to use resolveCodeAction #107853

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

mjbvz
Copy link
Collaborator

@mjbvz mjbvz commented Sep 30, 2020

Made while testing #106410

@mjbvz mjbvz added this to the October 2020 milestone Sep 30, 2020
@mjbvz mjbvz modified the milestones: October 2020, November 2020 Oct 30, 2020
Copy link

@rheh rheh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A couple of feedback points. Also, are there any unit tests for this?

@@ -51,6 +51,9 @@ class ApplyCodeActionCommand implements Command {
}
}

type ApplyFixAllCodeAction_args = {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Types should be PascalCase e.g. ApplyFixAllCodeAction_args -> ApplyFixAllCodeActionArgs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As the maintainer of this code, I'm going with this name here :)

@@ -384,7 +403,7 @@ function isPreferredFix(
return true;
}

if (otherAction.isFixAll) {
if (otherAction instanceof VsCodeFixAllCodeAction) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This and the above reference are the only usage of the isFixAll property on the VsCodeCodeAction class. Removing these makes the property redundant. Thus, it can be removed. However, it is better to encapsulate this logic within the class rather than having to use instanceOf. So, why not use the isFixAll and set the value to false in the super call within the VsCodeFixAllCodeAction constructor? (4 parameter)

@mjbvz mjbvz merged commit d04956f into microsoft:master Nov 10, 2020
@github-actions github-actions bot locked and limited conversation to collaborators Dec 25, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants