diff options
author | 最萌小汐 <sumneko@hotmail.com> | 2021-07-14 21:02:33 +0800 |
---|---|---|
committer | 最萌小汐 <sumneko@hotmail.com> | 2021-07-14 21:02:33 +0800 |
commit | 834d5e70092d38c884b23fe2bc176ed06f362c69 (patch) | |
tree | efd70348303f4d21249ffcb6e6b10779566b011c /script/core/hover/table.lua | |
parent | ad89a32126617db2e139edb90a4dac96bc0e0496 (diff) | |
download | lua-language-server-834d5e70092d38c884b23fe2bc176ed06f362c69.zip |
resolve #588
Diffstat (limited to 'script/core/hover/table.lua')
-rw-r--r-- | script/core/hover/table.lua | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/script/core/hover/table.lua b/script/core/hover/table.lua index bd0274cf..68a04b40 100644 --- a/script/core/hover/table.lua +++ b/script/core/hover/table.lua @@ -96,12 +96,20 @@ local function getKeyMap(fields) end end table.sort(keys, function (a, b) - local ta = typeSorter[type(a)] - local tb = typeSorter[type(b)] - if ta == tb then - return tostring(a) < tostring(b) + if a == b then + return false + end + local ta = type(a) + local tb = type(b) + local tsa = typeSorter[ta] + local tsb = typeSorter[tb] + if tsa == tsb then + if ta == 'boolean' then + return a == true + end + return a < b else - return ta < tb + return tsa < tsb end end) return keys |