Skip to content

Commit

Permalink
fix(signature): support label offsets
Browse files Browse the repository at this point in the history
  • Loading branch information
folke committed Apr 18, 2023
1 parent 29e47e4 commit 9649d9f
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lua/noice/lsp/signature.lua
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,12 @@ function M:format_signature(sig_index, sig)
local pdoc = table.concat(Format.format_markdown(p.documentation or ""), "\n")
local line = { "-" }
if p.label then
line[#line + 1] = "`" .. p.label .. "`"
local label = p.label
if type(label) == "table" then
label = sig.label:sub(label[1] + 1, label[2])
end

line[#line + 1] = "`[" .. label .. "]`"
end
line[#line + 1] = pdoc
lines[#lines + 1] = table.concat(line, " ")
Expand Down

0 comments on commit 9649d9f

Please sign in to comment.