mirror of
https://github.com/Myriad-Dreamin/tinymist.git
synced 2025-07-24 05:05:00 +00:00
dev: join array of hover contents by divider for neovim clients (#157)
* dev: join array of hover contents by divider for neovim client * dev: update snapshots
This commit is contained in:
parent
1c5c6bd929
commit
2ba806359a
2 changed files with 17 additions and 2 deletions
|
@ -51,6 +51,21 @@ impl StatefulRequest for HoverRequest {
|
|||
let ast_node = LinkedNode::new(source.root()).leaf_at(cursor)?;
|
||||
let range = ctx.to_lsp_range(ast_node.range(), &source);
|
||||
|
||||
let contents = match contents {
|
||||
LspHoverContents::Array(contents) => LspHoverContents::Scalar(MarkedString::String(
|
||||
contents
|
||||
.into_iter()
|
||||
.map(|e| match e {
|
||||
MarkedString::LanguageString(e) => {
|
||||
format!("```{}\n{}\n```", e.language, e.value)
|
||||
}
|
||||
MarkedString::String(e) => e,
|
||||
})
|
||||
.join("\n---\n"),
|
||||
)),
|
||||
contents => contents,
|
||||
};
|
||||
|
||||
Some(Hover {
|
||||
contents,
|
||||
range: Some(range),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue