forked from simrat39/symbols-outline.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsymbols.lua
50 lines (44 loc) · 757 Bytes
/
symbols.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
local config = require 'symbols-outline.config'
local M = {}
M.kinds = {
'File',
'Module',
'Namespace',
'Package',
'Class',
'Method',
'Property',
'Field',
'Constructor',
'Enum',
'Interface',
'Function',
'Variable',
'Constant',
'String',
'Number',
'Boolean',
'Array',
'Object',
'Key',
'Null',
'EnumMember',
'Struct',
'Event',
'Operator',
'TypeParameter',
'Component',
'Fragment',
}
function M.icon_from_kind(kind)
local symbols = config.options.symbols
if type(kind) == 'string' then
return symbols[kind].icon
end
-- If the kind is higher than the available ones then default to 'Object'
if kind > #M.kinds then
kind = 19
end
return symbols[M.kinds[kind]].icon
end
return M