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

Allow to not cut the signature received on hover

Open mattiasdrp opened this issue 3 years ago • 3 comments

Some servers (i.e. the ocamllsp one) return only the signature on hover (without the documentation) but tend to put newlines between the different items. With the current implementation of lsp-clients-extract-signature-on-hover, the displayed signature will only contain the first item

config1:string list ->
config2:string list -> config3:string list -> int -> int -> int

will then be rendered as

config1:string list ->

With the new implementation, a custom variable allows to take control over this behaviour and the function has been reimplemented to either return the previous result or return the signature with newlines replaced by spaces

mattiasdrp avatar Jul 24 '22 16:07 mattiasdrp

I need to check some things, don't review it right now ;-)

mattiasdrp avatar Jul 24 '22 17:07 mattiasdrp

you may do it like this: https://github.com/yyoncho/lsp-mode/blob/master/clients/lsp-clangd.el#L267

yyoncho avatar Jul 24 '22 17:07 yyoncho

Thanks a lot @yyoncho for the pointer, that's much better for me!

mattiasdrp avatar Jul 24 '22 20:07 mattiasdrp

Can you confirm that this is still relevant?

yyoncho avatar Oct 18 '22 19:10 yyoncho

Can you confirm that this is still relevant?

Still relevant, yes, rewrote the function in my .emacs.d until this is merged :-)

mattiasdrp avatar Oct 18 '22 20:10 mattiasdrp

Thank you for contributing to lsp-mode, and sorry for the delay.

yyoncho avatar Nov 21 '22 18:11 yyoncho