File tree Expand file tree Collapse file tree 2 files changed +10
-3
lines changed
Expand file tree Collapse file tree 2 files changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -63,12 +63,19 @@ let run (state : State.t) { SignatureHelpParams.textDocument = { uri }; position
6363 sprintf " %s : " fun_name
6464 in
6565 let offset = String. length prefix in
66- let + doc =
66+ let * doc =
6767 Document.Merlin. doc_comment
6868 ~name: " signature help-position"
6969 merlin
7070 application_signature.function_position
7171 in
72+ let + formatted_signature =
73+ let typ = application_signature.signature in
74+ let * result = Ocamlformat_rpc. format_type state.ocamlformat_rpc ~typ in
75+ match result with
76+ | Ok v -> Fiber. return (String. trim v)
77+ | Error _ -> Fiber. return typ
78+ in
7279 let info =
7380 let parameters =
7481 List. map
@@ -90,7 +97,7 @@ let run (state : State.t) { SignatureHelpParams.textDocument = { uri }; position
9097 in
9198 format_doc ~markdown ~doc
9299 in
93- let label = prefix ^ application_signature.signature in
100+ let label = prefix ^ formatted_signature in
94101 SignatureInformation. create ~label ?documentation ~parameters ()
95102 in
96103 SignatureHelp. create
Original file line number Diff line number Diff line change @@ -37,7 +37,7 @@ let _ : int = f
3737 " activeSignature" : 0 ,
3838 " signatures" : [
3939 {
40- " label" : " f : int -> int -> int -> int -> int -> int -> int -> int -> int -> int " ,
40+ " label" : " f : int ->\n int -> \n int -> \n int -> \n int -> \n int -> \n int -> \n int -> \n int -> \n int " ,
4141 " parameters" : [
4242 { " label" : [ 4 , 7 ] },
4343 { " label" : [ 11 , 14 ] },
You can’t perform that action at this time.
0 commit comments