Skip to content

Commit aa0fbf5

Browse files
committed
fix: add a missing check for inject-field diagnostics
1 parent 4670739 commit aa0fbf5

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

script/core/diagnostics/inject-field.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ return function (uri, callback)
6868
if def.type == 'doc.field' then
6969
return
7070
end
71+
if def.type == 'tablefield' then
72+
return
73+
end
7174
end
7275

7376
local howToFix = ''

test/diagnostics/inject-field.lua

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,16 @@ function m:init() -- OK
8282
end
8383
end
8484
]]
85+
86+
TEST [[
87+
---@class Class
88+
local m = {
89+
xx = 1, -- OK
90+
}
91+
92+
---@type Class
93+
local m
94+
95+
m.xx = 1 -- OK
96+
m.<!yy!> = 1 -- Warning
97+
]]

0 commit comments

Comments
 (0)