Skip to content

Commit 2dd1bdb

Browse files
committed
don't show any as field node
1 parent 5f48be0 commit 2dd1bdb

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

script/core/hover/name.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ local function asField(source, oop)
2020
local class
2121
if source.node.type ~= 'getglobal' then
2222
class = vm.getInfer(source.node):viewClass()
23+
if class == 'any' then
24+
class = nil
25+
end
2326
end
2427
local node = class
2528
or buildName(source.node, false)

test/hover/init.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1929,3 +1929,13 @@ local <?x?>
19291929
[[
19301930
local x: ` x | y `|`123 ????`
19311931
]]
1932+
1933+
TEST [[
1934+
---@type any
1935+
local x
1936+
1937+
print(x.<?y?>)
1938+
]]
1939+
[[
1940+
(field) x.y: unknown
1941+
]]

0 commit comments

Comments
 (0)