summaryrefslogtreecommitdiff
path: root/cli/lsp/tsc.rs
diff options
context:
space:
mode:
Diffstat (limited to 'cli/lsp/tsc.rs')
-rw-r--r--cli/lsp/tsc.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/cli/lsp/tsc.rs b/cli/lsp/tsc.rs
index 97fdb9cb6..5d5f5228c 100644
--- a/cli/lsp/tsc.rs
+++ b/cli/lsp/tsc.rs
@@ -3283,14 +3283,17 @@ impl CompletionEntryDetails {
None
};
let documentation = if let Some(parts) = &self.documentation {
+ // NOTE: similar as `QuickInfo::to_hover()`
let mut value = display_parts_to_string(parts, language_server);
if let Some(tags) = &self.tags {
- let tag_documentation = tags
+ let tags_preview = tags
.iter()
.map(|tag_info| get_tag_documentation(tag_info, language_server))
.collect::<Vec<String>>()
- .join("");
- value = format!("{value}\n\n{tag_documentation}");
+ .join(" \n\n");
+ if !tags_preview.is_empty() {
+ value = format!("{value}\n\n{tags_preview}");
+ }
}
Some(lsp::Documentation::MarkupContent(lsp::MarkupContent {
kind: lsp::MarkupKind::Markdown,