Format with stylua

This commit is contained in:
FollieHiyuki
2022-02-22 22:29:24 +07:00
parent 142963e97c
commit d980dbf947
18 changed files with 875 additions and 830 deletions

View File

@@ -1,24 +1,48 @@
local config = require('symbols-outline.config')
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"
'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',
}
function M.icon_from_kind(kind)
local symbols = config.options.symbols
local symbols = config.options.symbols
if type(kind) == 'string' then
return symbols[kind].icon
end
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
-- 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