diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2022-02-09 20:16:39 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2022-02-09 20:16:39 +0800 |
commit | 3932717d816bfc4f98cd9640daca51fb6f2afe8c (patch) | |
tree | 934e153b2a5b1427de71e4dc87074bc6b7ae9b71 /script/core/hover | |
parent | 2a439122a6d6d841fb99f08a1276c4400e5360fa (diff) | |
download | lua-language-server-3932717d816bfc4f98cd9640daca51fb6f2afe8c.zip |
cleanup
merge `doc.type.enums` and `doc.type.resumes` into `doc.type.types`
Diffstat (limited to 'script/core/hover')
-rw-r--r-- | script/core/hover/description.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/script/core/hover/description.lua b/script/core/hover/description.lua index 8733fa25..43d15c39 100644 --- a/script/core/hover/description.lua +++ b/script/core/hover/description.lua @@ -160,7 +160,10 @@ local function buildEnumChunk(docType, name) end local types = {} for _, tp in ipairs(docType.types) do - types[#types+1] = tp[1] + if tp.type ~= 'doc.enum' + and tp.type ~= 'doc.resume' then + types[#types+1] = tp[1] + end end local lines = {} for _, typeUnit in ipairs(docType.types) do @@ -171,12 +174,12 @@ local function buildEnumChunk(docType, name) end end end - lines[#lines+1] = ('%s: %s'):format(name, table.concat(types)) + lines[#lines+1] = ('%s: %s'):format(name, table.concat(types, '|')) for _, enum in ipairs(enums) do local enumDes = (' %s %s'):format( (enum.default and '->') - or (enum.additional and '+>') - or ' |', + or (enum.additional and '+>') + or ' |', enum[1] ) if enum.comment then |