summaryrefslogtreecommitdiff
path: root/script/core/hover
diff options
context:
space:
mode:
author最萌小汐 <sumneko@hotmail.com>2022-04-08 13:12:31 +0800
committer最萌小汐 <sumneko@hotmail.com>2022-04-08 13:12:31 +0800
commit3771e70b48e9a088cbdc11a8b952d525eea1e7c9 (patch)
tree065b1c5501dfaf1aef5c484f6128bc61cc75d054 /script/core/hover
parentb8c5db4d443e5a0c638d964104d8966f837eeb6a (diff)
downloadlua-language-server-3771e70b48e9a088cbdc11a8b952d525eea1e7c9.zip
cleanup
Diffstat (limited to 'script/core/hover')
-rw-r--r--script/core/hover/label.lua5
-rw-r--r--script/core/hover/table.lua7
2 files changed, 8 insertions, 4 deletions
diff --git a/script/core/hover/label.lua b/script/core/hover/label.lua
index 995c3294..c2239344 100644
--- a/script/core/hover/label.lua
+++ b/script/core/hover/label.lua
@@ -45,10 +45,7 @@ local function asValue(source, title)
local ifr = infer.getInfer(source)
local type = ifr:view()
local literal = ifr:viewLiterals()
- local cont
- if not ifr:hasType 'string' then
- cont = buildTable(source)
- end
+ local cont = buildTable(source)
local pack = {}
pack[#pack+1] = title
pack[#pack+1] = name .. ':'
diff --git a/script/core/hover/table.lua b/script/core/hover/table.lua
index 88808daa..8f9beefe 100644
--- a/script/core/hover/table.lua
+++ b/script/core/hover/table.lua
@@ -163,6 +163,13 @@ return function (source)
return nil
end
+ for view in infer.getInfer(source):eachView() do
+ if view == 'string'
+ or vm.isSubType(view, 'string') then
+ return nil
+ end
+ end
+
local fields = vm.getFields(source)
local keys, map = getKeyMap(fields)
if #keys == 0 then