File tree Expand file tree Collapse file tree 2 files changed +4
-14
lines changed
Expand file tree Collapse file tree 2 files changed +4
-14
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,9 @@ let emit_possible_actions_from_warning loc w =
2020 match w with
2121 | Warnings. Unused_open _ ->
2222 add_possible_action {loc; action = RemoveOpen ; description = " Remove open" }
23+ | Unused_match | Unreachable_case ->
24+ add_possible_action
25+ {loc; action = RemoveSwitchCase ; description = " Remove switch case" }
2326 | _ -> ()
2427
2528let _ =
Original file line number Diff line number Diff line change @@ -2200,25 +2200,12 @@ let check_unused pred casel =
22002200 let pattern = {pattern with Parsetree. ppat_loc = q.pat_loc} in
22012201 match pred constrs labels pattern with
22022202 | None ->
2203- Cmt_utils. add_possible_action
2204- {
2205- loc = q.pat_loc;
2206- action = RemoveSwitchCase ;
2207- description = " Remove switch case" ;
2208- };
22092203 Location. prerr_warning q.pat_loc Warnings. Unreachable_case ;
22102204 Used
22112205 | _ -> r
22122206 in
22132207 match r with
2214- | Unused ->
2215- Location. prerr_warning q.pat_loc Warnings. Unused_match ;
2216- Cmt_utils. add_possible_action
2217- {
2218- loc = q.pat_loc;
2219- action = RemoveSwitchCase ;
2220- description = " Remove switch case" ;
2221- }
2208+ | Unused -> Location. prerr_warning q.pat_loc Warnings. Unused_match
22222209 | Upartial ps ->
22232210 ps
22242211 |> List. filter (fun p ->
You can’t perform that action at this time.
0 commit comments