diff options
-rw-r--r-- | script/core/hover/label.lua | 5 | ||||
-rw-r--r-- | test/hover/init.lua | 11 |
2 files changed, 15 insertions, 1 deletions
diff --git a/script/core/hover/label.lua b/script/core/hover/label.lua index 2fb0b14c..68af973e 100644 --- a/script/core/hover/label.lua +++ b/script/core/hover/label.lua @@ -57,7 +57,10 @@ local function asValue(source, title) local pack = {} pack[#pack+1] = title pack[#pack+1] = name .. ':' - if cont and type == 'table' then + if cont + and ( type == 'table' + or type == 'any' + or type == 'nil') then type = nil end if class then diff --git a/test/hover/init.lua b/test/hover/init.lua index 27cc62ee..dc9125ed 100644 --- a/test/hover/init.lua +++ b/test/hover/init.lua @@ -1515,3 +1515,14 @@ local <?x?>--测试 [[ local x: any ]] + +TEST [[ +---@type any +local <?t?> +t.a = 1 +]] +[[ +local t: { + a: integer = 1, +} +]] |