Skip to content

Commit 5d0722b

Browse files
committed
[reference] Check also in tablefield
1 parent b815469 commit 5d0722b

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

script/vm/ref.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ local function searchWord(source, pushResult, defMap, fileNotify)
109109
end)
110110
end
111111
---@async
112-
guide.eachSourceTypes(state.ast, {'getfield', 'setfield'}, function (src)
112+
guide.eachSourceTypes(state.ast, {'getfield', 'setfield', 'tablefield'}, function (src)
113113
if src.field and src.field[1] == key then
114114
checkDef(src)
115115
await.delay()

test/references/all.lua

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,3 +139,13 @@ function TestB(param)
139139
param:<!TestA!>()
140140
end
141141
]]
142+
143+
TEST [[
144+
---@class A
145+
---@field <~x~> number
146+
147+
---@type A
148+
local t = {
149+
<!x!> = 1
150+
}
151+
]]

0 commit comments

Comments
 (0)