Skip to content

Commit

Permalink
feat: add detail to documentation window (#33)
Browse files Browse the repository at this point in the history
Co-authored-by: telebart <[email protected]>
  • Loading branch information
telebart and telebart authored Oct 10, 2024
1 parent a6cf72a commit 588e4d4
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lua/blink/cmp/windows/documentation.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,16 @@ function docs.show_item(item)
return
end

local doc = type(item.documentation) == 'string' and item.documentation or item.documentation.value
local doc_lines = {}
if item.detail and item.detail ~= '' then
table.insert(doc_lines, '```'..vim.bo.filetype)
for s in item.detail:gmatch('[^\r\n]+') do
table.insert(doc_lines, s)
end
table.insert(doc_lines, '```')
end

local doc = type(item.documentation) == 'string' and item.documentation or item.documentation.value
for s in doc:gmatch('[^\r\n]+') do
table.insert(doc_lines, s)
end
Expand Down

0 comments on commit 588e4d4

Please sign in to comment.