feat(lsp): add snippet support and refactor completion into Item class
This commit is contained in:
+5
-6
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user