Skip to content

Commit 588e4d4

Browse files
telebarttelebart
and
telebart
authored
feat: add detail to documentation window (#33)
Co-authored-by: telebart <[email protected]>
1 parent a6cf72a commit 588e4d4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

lua/blink/cmp/windows/documentation.lua

+9-1
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,16 @@ function docs.show_item(item)
5454
return
5555
end
5656

57-
local doc = type(item.documentation) == 'string' and item.documentation or item.documentation.value
5857
local doc_lines = {}
58+
if item.detail and item.detail ~= '' then
59+
table.insert(doc_lines, '```'..vim.bo.filetype)
60+
for s in item.detail:gmatch('[^\r\n]+') do
61+
table.insert(doc_lines, s)
62+
end
63+
table.insert(doc_lines, '```')
64+
end
65+
66+
local doc = type(item.documentation) == 'string' and item.documentation or item.documentation.value
5967
for s in doc:gmatch('[^\r\n]+') do
6068
table.insert(doc_lines, s)
6169
end

0 commit comments

Comments
 (0)