Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Lspsaga hover_doc displays weird \s #90

Open
wizard-28 opened this issue Feb 27, 2022 · 6 comments · May be fixed by #93
Open

Lspsaga hover_doc displays weird \s #90

wizard-28 opened this issue Feb 27, 2022 · 6 comments · May be fixed by #93
Labels
bug Something isn't working

Comments

@wizard-28
Copy link

Description

Lspsaga's hover doc command doesn't escape some characters properly.

Expected Behavior

It escapes the characters properly.

Actual Behavior

As you can see lot of \ are present in the hover doc. This is a screenshot of :Lspsaga hover_doc

Neovim Built in Behavior

This is vim.lsp.buf.hover(), it escapes the characters properly.

Details

Reproduce
  1. Open a python file with Pyright LSP for example
  2. Compare the doc shown between Lspsaga hover_doc and vim.lsp.buf.hover()
Environment
@wizard-28 wizard-28 added the bug Something isn't working label Feb 27, 2022
@kkharji
Copy link
Owner

kkharji commented Mar 3, 2022

Yah, I noticed that with one other server I forgot about. I believe it should be an easy fix, hopefully soon, but by all mean a pr is welcomed

@wizard-28
Copy link
Author

Yah, I noticed that with one other server I forgot about. I believe it should be an easy fix, hopefully soon, but by all mean a pr is welcomed

Thank you, but I would prefer the Lspsaga team to fix it.

@againxx
Copy link
Contributor

againxx commented Mar 6, 2022

This seems can be fixed by changing the syntax type of the hover window from markdown into lsp_markdown and set conceallevel=2, as shown in the following screenshots.

Before:
before_lsp_markdown
After:
after_lsp_markdown

Or maybe we could just reuse vim.lsp.util.stylize_markdown()? It has lots of similarities to the lspsaga's fancy_floating_markdown(). What's your idea? @tami5

@kkharji
Copy link
Owner

kkharji commented Mar 6, 2022

It has lots of similarities to the lspsaga's fancy_floating_markdown().

some stuff in lsp core is inspired by Lspsaga .

🤔 lsp_markdown makes sense to use as users may have bunch of autocmd tied with markdown filetype like I do. I'm with making and reusing our own thing, so that in the future we will have the flexibility of adding features.

@againxx with the above mentioned, feel free to choice whatever makes more sense to you

@againxx againxx linked a pull request Mar 6, 2022 that will close this issue
@kkharji
Copy link
Owner

kkharji commented Mar 10, 2022

reuse vim.lsp.util.stylize_markdown()

I'm right now looking into and I guess @glepnir copied it over and made few adjustments, I'm experimenting with new version right now

@AGou-ops
Copy link

@tami5
I have a similar problem, but a little bit different from @againxx.
image

  • MacOS 12.3
  • Nvim 0.6.1
  • latest lspsaga

How should I fix this?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants