fix(symbols): Handle unkown symbols

Default to the Object icon
Closes #28
This commit is contained in:
simrat39
2021-07-13 20:41:42 -07:00
parent 72c3d49cc6
commit 74fd5bf67d

View File

@@ -34,6 +34,10 @@ M.kinds = {
"EnumMember", "Struct", "Event", "Operator", "TypeParameter" "EnumMember", "Struct", "Event", "Operator", "TypeParameter"
} }
function M.icon_from_kind(kind) return M[M.kinds[kind]].icon end 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 return M