Skip to content

Commit c966d0d

Browse files
authored
fix: add separator between result.contents of textDocument/hover (#163)
1 parent c174dc5 commit c966d0d

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

init.lua

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1573,14 +1573,16 @@ function lsp.request_hover(doc, line, col, in_tab)
15731573
text = content.value
15741574
if content.kind then kind = content.kind end
15751575
else
1576+
local texts = {}
15761577
for _, element in pairs(content) do
15771578
if type(element) == "string" then
1578-
text = text .. element
1579+
table.insert(texts, element)
15791580
elseif type(element) == "table" and element.value then
1580-
text = text .. element.value
1581+
table.insert(texts, element.value)
15811582
if not kind and element.kind then kind = element.kind end
15821583
end
15831584
end
1585+
text = table.concat(texts, "\n\n")
15841586
end
15851587
else -- content should be a string
15861588
text = content

0 commit comments

Comments
 (0)