-
Notifications
You must be signed in to change notification settings - Fork 1.7k
honour hover.content_format client capability #6140
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This removes all markdown when the client does not support the markdown MarkupKind Otherwise the output on the editor will have some markdown boilerplate, making it less readable
match event { | ||
Event::Text(text) | Event::Code(text) => out.push_str(&text), | ||
Event::SoftBreak | Event::HardBreak | Event::Rule => out.push('\n'), | ||
_ => {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think you should also push *
for list items. Otherwise
- foo
- bar
would be rendered as
foo
bar
which doesn't look like a list at all. You should also render tables using ascii art I think.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure where it goes, but is it possible to preserve the empty line in the example?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Event::End(Tag::CodeBlock(_))
Was the empty line missing otherwise?
Looks good to me, (with the exception of the two boolean arguments function, which I'm not a fan of but is probably fine for now), but I didn't test it.
This should also apply to completion and signature help requests. |
cc @flw-cn Am I correct that vim8 generally handles markdowns, and its only the links that create problems? |
bors r=lnicola |
Yes. vim8 is capable of rendering markdown correctly, including highlighting blocks and bold and italic, etc. Only links are not handled very well. |
I don't think this is right. We're still rendering markdown: https://github.com/rust-analyzer/rust-analyzer/blob/518f6d772482c7c58e59081f340947087a9b4800/crates/rust-analyzer/src/handlers.rs#L633 |
Ah, there should be no markdown in the message, but it is still marked as a markdown string. |
This removes all markdown when the client does not support the markdown MarkupKind.
Otherwise the output on the editor will have some markdown boilerplate, making it less readable.
For example kak_lsp does not currently support markdown.

after:
