languageserver icon indicating copy to clipboard operation
languageserver copied to clipboard

Over does not display help correctly

Open PMassicotte opened this issue 1 year ago • 5 comments

I am using lspsaga to enhance LSP in neovim (https://github.com/nvimdev/lspsaga.nvim).

One interesting feature is the over (https://nvimdev.github.io/lspsaga/hover/) function (shift+k) that provides function help. When I use this function in other language, the display looks like this:

In Rust:

image

In Python:

image

However, while this kinda works with R, the information is displayed as Markdown/HTML:

image

Anyone know if this could be easily fixed?

PMassicotte avatar Jun 28 '24 17:06 PMassicotte

Hi @PMassicotte, you can solve this setting r.lsp.rich_documentation to false in your lspsaga config. I use mason so I don't know how to configure this setting in lspsaga.

rumichaska avatar Jul 02 '24 16:07 rumichaska

cool let me try!

PMassicotte avatar Jul 02 '24 16:07 PMassicotte

I was able to get it working (I think) by adding languageserver.rich_documentation = FALSE, in my .Rprofile.

image

cc @jalvesaq for future reference (adding information in R.nvim).

PMassicotte avatar Jul 02 '24 16:07 PMassicotte

While setting r.lsp.rich_documentation to false avoids formatting problems, it downgrades the user experience by removing the syntax highlighting. It could be better if https://github.com/REditorSupport/languageserver/blob/master/inst/lua/html-to-markdown.lua could be improved to remove the remaining <div> tags and format the Arguments in a different way (not in table format).

jalvesaq avatar Jul 02 '24 17:07 jalvesaq

I think this is a good suggestion. Would that require a lot of work? Happy to help if needed.

PMassicotte avatar Jul 02 '24 17:07 PMassicotte