Skip to content

Commit

Permalink
refactor according to code reveiw
Browse files Browse the repository at this point in the history
  • Loading branch information
PizieDust committed Jul 18, 2024
1 parent b27a97d commit 2350109
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion ocaml-lsp-server/src/custom_requests/custom_request.ml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ module Switch_impl_intf = Req_switch_impl_intf
module Typed_holes = Req_typed_holes
module Type_enclosing = Req_type_enclosing
module Wrapping_ast_node = Req_wrapping_ast_node
module Documentation = Req_documentation
module Get_documentation = Req_get_documentation
2 changes: 1 addition & 1 deletion ocaml-lsp-server/src/custom_requests/custom_request.mli
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ module Switch_impl_intf = Req_switch_impl_intf
module Typed_holes = Req_typed_holes
module Type_enclosing = Req_type_enclosing
module Wrapping_ast_node = Req_wrapping_ast_node
module Documentation = Req_documentation
module Get_documentation = Req_get_documentation
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ open Import
module TextDocumentPositionParams = Lsp.Types.TextDocumentPositionParams

let meth = "ocamllsp/getDocumentation"
let capability = "handleDocumentation", `Bool true
let capability = "handleGetDocumentation", `Bool true

module GetDocClientCapabilities = struct
type _t = { contentFormat : MarkupKind.t list }
Expand Down
4 changes: 2 additions & 2 deletions ocaml-lsp-server/src/ocaml_lsp_server.ml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ let initialize_info (client_capabilities : ClientCapabilities.t) : InitializeRes
; Req_hover_extended.capability
; Req_merlin_call_compatible.capability
; Req_type_enclosing.capability
; Req_documentation.capability
; Req_get_documentation.capability
] )
]
in
Expand Down Expand Up @@ -508,7 +508,7 @@ let on_request
; Req_typed_holes.meth, Req_typed_holes.on_request
; Req_merlin_call_compatible.meth, Req_merlin_call_compatible.on_request
; Req_type_enclosing.meth, Req_type_enclosing.on_request
; Req_documentation.meth, Req_documentation.on_request
; Req_get_documentation.meth, Req_get_documentation.on_request
; Req_wrapping_ast_node.meth, Req_wrapping_ast_node.on_request
; ( Semantic_highlighting.Debug.meth_request_full
, Semantic_highlighting.Debug.on_request_full )
Expand Down
4 changes: 2 additions & 2 deletions ocaml-lsp-server/test/e2e-new/documentation.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
open Test.Import
module Req = Ocaml_lsp_server.Custom_request.Documentation
module Req = Ocaml_lsp_server.Custom_request.Get_documentation

module Util = struct
let call_documentation ~position ?(identifier = None) ?(contentFormat = None) client =
Expand All @@ -18,7 +18,7 @@ module Util = struct
;;

let print_documentation result =
result |> Yojson.Safe.pretty_to_string ~std:false |> print_endline
Test.print_result result
;;

let test ~line ~character ?identifier ?contentFormat source =
Expand Down
2 changes: 1 addition & 1 deletion ocaml-lsp-server/test/e2e-new/start_stop.ml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ let%expect_test "start/stop" =
"handleHoverExtended": true,
"handleMerlinCallCompatible": true,
"handleTypeEnclosing": true,
"handleDocumentation": true
"handleGetDocumentation": true
}
},
"foldingRangeProvider": true,
Expand Down

0 comments on commit 2350109

Please sign in to comment.