Skip to content

Commit

Permalink
lsp: Better hover information for images in text only editors
Browse files Browse the repository at this point in the history
Whow the path when the editor can not render the image itself.
  • Loading branch information
hunger committed Dec 9, 2024
1 parent d154cde commit eec8c39
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/lsp/language/hover.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub fn get_tooltip(document_cache: &mut DocumentCache, token: SyntaxToken) -> Op
},
TokenInfo::Image(path) => MarkupContent {
kind: lsp_types::MarkupKind::Markdown,
value: format!("![Image]({})", path.to_string_lossy()),
value: format!("![{0}]({0})", path.to_string_lossy()),
},
// Todo: this can happen when there is some syntax error
TokenInfo::LocalProperty(_) | TokenInfo::LocalCallback(_) => return None,
Expand Down

0 comments on commit eec8c39

Please sign in to comment.