Skip to content

Commit

Permalink
Merge remote-tracking branch 'rqdmap/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
hedyhli committed Nov 1, 2023
2 parents ede61eb + b740f88 commit a240ba4
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 30 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,6 +187,11 @@ local opts = {
TypeParameter = { icon = "𝙏", hl = "@parameter" },
Component = { icon = "󰅴", hl = "@function" },
Fragment = { icon = "󰅴", hl = "@constant" },
-- ccls
TypeAlias = { icon = '', hl = '@type' },
Parameter = { icon = '', hl = '@parameter' },
StaticMethod = { icon = '', hl = '@function' },
Macro = { icon = '', hl = '@macro' },
},
}
```
Expand Down
5 changes: 5 additions & 0 deletions lua/symbols-outline/config.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ M.defaults = {
TypeParameter = { icon = '𝙏', hl = '@parameter' },
Component = { icon = '󰅴', hl = '@function' },
Fragment = { icon = '󰅴', hl = '@constant' },
-- ccls
TypeAlias = { icon = '', hl = '@type' },
Parameter = { icon = '', hl = '@parameter' },
StaticMethod = { icon = '', hl = '@function' },
Macro = { icon = '', hl = '@macro' },
},
}

Expand Down
66 changes: 36 additions & 30 deletions lua/symbols-outline/symbols.lua
Original file line number Diff line number Diff line change
Expand Up @@ -3,34 +3,40 @@ 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',
[1] = 'File',
[2] = 'Module',
[3] = 'Namespace',
[4] = 'Package',
[5] = 'Class',
[6] = 'Method',
[7] = 'Property',
[8] = 'Field',
[9] = 'Constructor',
[10] = 'Enum',
[11] = 'Interface',
[12] = 'Function',
[13] = 'Variable',
[14] = 'Constant',
[15] = 'String',
[16] = 'Number',
[17] = 'Boolean',
[18] = 'Array',
[19] = 'Object',
[20] = 'Key',
[21] = 'Null',
[22] = 'EnumMember',
[23] = 'Struct',
[24] = 'Event',
[25] = 'Operator',
[26] = 'TypeParameter',
[27] = 'Component',
[28] = 'Fragment',

-- ccls
[252] = 'TypeAlias',
[253] = 'Parameter',
[254] = 'StaticMethod',
[255] = 'Macro',
}

function M.icon_from_kind(kind)
Expand All @@ -40,8 +46,8 @@ function M.icon_from_kind(kind)
return symbols[kind].icon
end

-- If the kind is higher than the available ones then default to 'Object'
if kind > #M.kinds then
-- If the kind index is not available then default to 'Object'
if M.kinds[kind] == nil then
kind = 19
end
return symbols[M.kinds[kind]].icon
Expand Down

0 comments on commit a240ba4

Please sign in to comment.