Skip to content

Commit

Permalink
Minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Jack Feser committed Oct 11, 2021
1 parent 6e7da24 commit c9f2efa
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions ocaml-lsp-server/src/code_actions/action_mark_remove_unused.ml
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,9 @@ let code_action_mark_value_unused doc (diagnostic : Diagnostic.t) =
let var_name = slice doc diagnostic.range in
let pos = diagnostic.range.start in
let+ text_edit =
let contexts =
enclosing_pos pipeline pos
|> List.map ~f:(fun (_, x) -> x)
|> List.rev
in
mark_value_unused_edit var_name contexts
enclosing_pos pipeline pos
|> List.rev_map ~f:(fun (_, x) -> x)
|> mark_value_unused_edit var_name
in
let edit = Document.edit doc text_edit in
CodeAction.create ~diagnostics:[ diagnostic ] ~title:"Mark as unused"
Expand Down Expand Up @@ -141,4 +138,4 @@ let code_action doc (params : CodeActionParams.t) =
let open Fiber.O in
let* mark_unused = code_action_mark_value_unused doc d in
let+ remove_unused = code_action_remove_value doc pos d in
List.filter_map ~f:Fun.id [ mark_unused; remove_unused ]
List.filter_opt [ mark_unused; remove_unused ]

0 comments on commit c9f2efa

Please sign in to comment.