New codefix provider to remove superflous binding for a Union case that has 0 fields.#14267
Merged
T-Gro merged 1 commit intodotnet:mainfrom Nov 8, 2022
Conversation
Member
Author
|
/run fantomas |
Contributor
Member
|
Huh, interesting that it failed to run fantomas. Need to check what's up with it |
vzarytovskii
approved these changes
Nov 8, 2022
Contributor
|
@T-Gro This looks awesome . |
Contributor
|
fsharp/fslang-suggestions#1094 would be a godsend in cases like this. |
psfinaki
approved these changes
Nov 8, 2022
Member
Author
Oh yes, the relevant part of the tree when spotting a diagnostic (since it is available "at hand") could directly flow with it. |
Contributor
|
@T-Gro While I was adding the same quick fix for Rider. I notice that we can also use the same quick fix for type E =
| A = 1
| B = 2
let (E.A x) = E.A
match E.A with
| E.A x -> ()
let [<Literal>] A = 1
match 1 with
| (A x) -> ()See JetBrains/resharper-fsharp#444 for more info |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This kicks in when:
This builds on top of the new diagnostics added via #14055
CodeFixRemoveSuperflousBinding.mp4