feat(lsp): add snippet support and refactor completion into Item class

This commit is contained in:
2026-04-17 00:03:03 +02:00
parent 5ecec7cc6c
commit 47f36adc21
9 changed files with 213 additions and 144 deletions
+5 -6
View File
@@ -56,17 +56,16 @@ local DEFAULT_HIGHLIGHTS = {
Reference = "Special",
}
--- Look up icon and highlight group for an LSP CompletionItemKind number.
---@param kind integer?
---@return string icon empty string if the kind is unknown
---@return string? hl nil if the kind is unknown
---@param kind? integer
---@return string? icon
---@return string? hl
function M.get(kind)
if not kind then
return "", nil
return nil, nil
end
local name = vim.lsp.protocol.CompletionItemKind[kind]
if not name or not M.ICONS[name] then
return "", nil
return nil, nil
end
return M.ICONS[name], "OwLspKind" .. name
end