Files
outline.nvim/lua/symbols-outline/symbols.lua
simrat39 74fd5bf67d fix(symbols): Handle unkown symbols
Default to the Object icon
Closes #28
2021-07-13 20:41:42 -07:00

44 lines
1.6 KiB
Lua
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

local M = {}
M.File = {icon = "", hl = "TSURI"}
M.Module = {icon = "", hl = "TSNamespace"}
M.Namespace = {icon = "", hl = "TSNamespace"}
M.Package = {icon = "", hl = "TSNamespace"}
M.Class = {icon = "𝓒", hl = "TSType"}
M.Method = {icon = "ƒ", hl = "TSMethod"}
M.Property = {icon = "", hl = "TSMethod"}
M.Field = {icon = "", hl = "TSField"}
M.Constructor = {icon = "", hl = "TSConstructor"}
M.Enum = {icon = "", hl = "TSType"}
M.Interface = {icon = "", hl = "TSType"}
M.Function = {icon = "", hl = "TSFunction"}
M.Variable = {icon = "", hl = "TSConstant"}
M.Constant = {icon = "", hl = "TSConstant"}
M.String = {icon = "𝓐", hl = "TSString"}
M.Number = {icon = "#", hl = "TSNumber"}
M.Boolean = {icon = "", hl = "TSBoolean"}
M.Array = {icon = "", hl = "TSConstant"}
M.Object = {icon = "⦿", hl = "TSType"}
M.Key = {icon = "🔐", hl = "TSType"}
M.Null = {icon = "NULL", hl = "TSType"}
M.EnumMember = {icon = "", hl = "TSField"}
M.Struct = {icon = "𝓢", hl = "TSType"}
M.Event = {icon = "🗲", hl = "TSType"}
M.Operator = {icon = "+", hl = "TSOperator"}
M.TypeParameter = {icon = "𝙏", hl = "TSParameter"}
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"
}
function M.icon_from_kind(kind)
-- If the kind is higher than the available ones then default to 'Object'
if kind > #M.kinds then kind = 19 end
return M[M.kinds[kind]].icon
end
return M