Skip to content

Commit 0b53f8a

Browse files
committed
action to action_kind
Signed-off-by: Rudi Grinberg <[email protected]>
1 parent d6c917f commit 0b53f8a

File tree

3 files changed

+7
-7
lines changed

3 files changed

+7
-7
lines changed

ocaml-lsp-server/src/destruct_lsp.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
open Import
22

3-
let action = "destruct"
3+
let action_kind = "destruct"
44

55
let code_action_of_case_analysis uri (loc, newText) =
66
let edit : WorkspaceEdit.t =
77
let textedit : TextEdit.t = { range = Range.of_loc loc; newText } in
88
let uri = Uri.to_string uri in
99
WorkspaceEdit.create ~changes:[ (uri, [ textedit ]) ] ()
1010
in
11-
let title = String.capitalize_ascii action in
12-
CodeAction.create ~title ~kind:(CodeActionKind.Other action) ~edit
11+
let title = String.capitalize_ascii action_kind in
12+
CodeAction.create ~title ~kind:(CodeActionKind.Other action_kind) ~edit
1313
~isPreferred:false ()
1414

1515
let code_action doc (params : CodeActionParams.t) =

ocaml-lsp-server/src/destruct_lsp.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
open Import
22

3-
val action : string
3+
val action_kind : string
44

55
val code_action :
66
Document.t

ocaml-lsp-server/src/ocaml_lsp_server.ml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ let not_supported () =
1414

1515
let initialize_info : InitializeResult.t =
1616
let codeActionProvider =
17-
let codeActionKinds = [ CodeActionKind.Other Destruct_lsp.action ] in
17+
let codeActionKinds = [ CodeActionKind.Other Destruct_lsp.action_kind ] in
1818
`CodeActionOptions (CodeActionOptions.create ~codeActionKinds ())
1919
in
2020
let textDocumentSync =
@@ -157,8 +157,8 @@ let code_action server (params : CodeActionParams.t) =
157157
let state : State.t = Server.state server in
158158
let store = state.store in
159159
match params.context.only with
160-
| Some set when not (List.mem (CodeActionKind.Other Destruct_lsp.action) ~set)
161-
->
160+
| Some set
161+
when not (List.mem (CodeActionKind.Other Destruct_lsp.action_kind) ~set) ->
162162
Fiber.return (Ok (None, state))
163163
| Some _
164164
| None ->

0 commit comments

Comments
 (0)