File tree Expand file tree Collapse file tree 3 files changed +35
-16
lines changed Expand file tree Collapse file tree 3 files changed +35
-16
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## Fixes
4
4
5
+ - Respect codeActionLiteralSupport capability (#1046 )
6
+
5
7
- Fix a document syncing issue when utf-16 is the position encoding (#1004 )
8
+
6
9
- Disable "Type-annotate" action for code that is already annotated.
7
10
([ #1037 ] ( https://github.com/ocaml/ocaml-lsp/pull/1037 ) ), fixes
8
11
[ #1036 ] ( https://github.com/ocaml/ocaml-lsp/issues/1036 )
Original file line number Diff line number Diff line change @@ -30,21 +30,24 @@ let view_metrics server =
30
30
let initialize_info (client_capabilities : ClientCapabilities.t ) :
31
31
InitializeResult. t =
32
32
let codeActionProvider =
33
- let codeActionKinds =
34
- Action_inferred_intf. kind :: Action_destruct. kind
35
- :: List. map
36
- ~f: (fun (c : Code_action.t ) -> c.kind)
37
- [ Action_type_annotate. t
38
- ; Action_remove_type_annotation. t
39
- ; Action_construct. t
40
- ; Action_refactor_open. unqualify
41
- ; Action_refactor_open. qualify
42
- ; Action_add_rec. t
43
- ; Action_inline. t
44
- ]
45
- |> List. sort_uniq ~compare: Poly. compare
46
- in
47
- `CodeActionOptions (CodeActionOptions. create ~code ActionKinds () )
33
+ match client_capabilities.textDocument with
34
+ | Some { codeAction = Some { codeActionLiteralSupport = Some _ ; _ } ; _ } ->
35
+ let codeActionKinds =
36
+ Action_inferred_intf. kind :: Action_destruct. kind
37
+ :: List. map
38
+ ~f: (fun (c : Code_action.t ) -> c.kind)
39
+ [ Action_type_annotate. t
40
+ ; Action_remove_type_annotation. t
41
+ ; Action_construct. t
42
+ ; Action_refactor_open. unqualify
43
+ ; Action_refactor_open. qualify
44
+ ; Action_add_rec. t
45
+ ; Action_inline. t
46
+ ]
47
+ |> List. sort_uniq ~compare: Poly. compare
48
+ in
49
+ `CodeActionOptions (CodeActionOptions. create ~code ActionKinds () )
50
+ | _ -> `Bool true
48
51
in
49
52
let textDocumentSync =
50
53
`TextDocumentSyncOptions
Original file line number Diff line number Diff line change @@ -16,7 +16,20 @@ let%expect_test "start/stop" =
16
16
in
17
17
WindowClientCapabilities. create ~show Document ()
18
18
in
19
- ClientCapabilities. create ~window ()
19
+ let textDocument =
20
+ let codeAction =
21
+ let codeActionLiteralSupport =
22
+ let codeActionKind =
23
+ CodeActionClientCapabilities. create_codeActionKind ~value Set:[]
24
+ in
25
+ CodeActionClientCapabilities. create_codeActionLiteralSupport
26
+ ~code ActionKind
27
+ in
28
+ CodeActionClientCapabilities. create ~code ActionLiteralSupport ()
29
+ in
30
+ TextDocumentClientCapabilities. create ~code Action ()
31
+ in
32
+ ClientCapabilities. create ~window ~text Document ()
20
33
in
21
34
Client. start client (InitializeParams. create ~capabilities () )
22
35
in
You can’t perform that action at this time.
0 commit comments