honor content_format clientcap

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
This commit is contained in:
Robin van Dijk
2020-10-05 19:27:29 +02:00
parent e5f252ade7
commit c3cc361294
5 changed files with 74 additions and 9 deletions

View File

@@ -618,7 +618,11 @@ pub(crate) fn handle_hover(
) -> Result<Option<lsp_ext::Hover>> {
let _p = profile::span("handle_hover");
let position = from_proto::file_position(&snap, params.text_document_position_params)?;
let info = match snap.analysis.hover(position, snap.config.hover.links_in_hover)? {
let info = match snap.analysis.hover(
position,
snap.config.hover.links_in_hover,
snap.config.hover.markdown,
)? {
None => return Ok(None),
Some(info) => info,
};