ocaml-lsp icon indicating copy to clipboard operation
ocaml-lsp copied to clipboard

Flatten signatures when they're not too long but are formatted in rows

Open mattiasdrp opened this issue 3 years ago • 1 comments

With the following function:

let f ~(_conf : string list) ~(_backtrace : string list) x y = x +. y

If I ask its type with M-x lsp-describe-thing-at-point I have the following answer:

_conf:string list -> _backtrace:string list -> float -> float -> float

And if I put my cursor over it to have its type displayed simply:

image

Now, if I have instead this function:

let g ~(_conf : string list) ~(_backtrace : string list) ~(_path : string list)
    x y =
  x +. y

The type obtained with M-x lsp-describe-thing-at-point is:

_conf:string list ->
_backtrace:string list -> _path:string list -> float -> float -> float

And the hovered type is displayed like this:

image

I don't know if that's the expected behaviour but wouldn't there be a way to create a newline as late as possible and mark that there is still some type to display?

mattiasdrp avatar Jul 15 '22 16:07 mattiasdrp

I tried installing ocamlformat-rpc as advised here but I couldn't see any difference. What is it supposed to do?

mattiasdrp avatar Jul 24 '22 21:07 mattiasdrp