You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
navigator.lua/lua/navigator/lspclient/lspkind.lua

136 lines
2.0 KiB
Lua

3 years ago
local kind_symbols = {
2 years ago
Text = '',
Method = 'ƒ',
Function = '',
Constructor = '',
Field = '',
Variable = '',
Class = '',
Interface = '',
Module = '',
Property = '',
Unit = '',
Value = '',
Enum = '',
Keyword = '',
Snippet = '',
Color = '',
File = '',
Reference = '',
Folder = '',
EnumMember = '',
Constant = '',
Struct = '',
Event = '',
Operator = '',
TypeParameter = '',
Default = '',
3 years ago
}
local CompletionItemKind = {
2 years ago
'',
'𝔉 ',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'𝕰 ',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
}
-- A symbol kind.
2 years ago
-- local SymbolKind = {
-- File = 1,
-- Module = 2,
-- Namespace = 3,
-- Package = 4,
-- Class = 5,
-- Method = 6,
-- Property = 7,
-- Field = 8,
-- Constructor = 9,
-- Enum = 10,
-- Interface = 11,
-- Function = 12,
-- Variable = 13,
-- Constant = 14,
-- String = 15,
-- Number = 16,
-- Boolean = 17,
-- Array = 18,
-- Object = 19,
-- Key = 20,
-- Null = 21,
-- EnumMember = 22,
-- Struct = 23,
-- Event = 24,
-- Operator = 25,
-- TypeParameter = 26
-- }
3 years ago
local SymbolItemKind = {
2 years ago
'',
'',
'',
'',
'',
'ƒ ',
'',
'',
'',
'𝕰 ',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
'',
}
local lspkind = {}
2 years ago
function lspkind.comp_kind(kind)
return CompletionItemKind[kind] or ''
end
3 years ago
2 years ago
function lspkind.symbol_kind(kind)
return SymbolItemKind[kind] or ''
end
3 years ago
2 years ago
function lspkind.cmp_kind(kind)
return kind_symbols[kind] or ''
end
2 years ago
function lspkind.init()
require('vim.lsp.protocol').CompletionItemKind = CompletionItemKind
end
3 years ago
return lspkind