File tree 2 files changed +21
-2
lines changed
2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -17,14 +17,16 @@ return function (uri, callback)
17
17
18
18
local defs = vm .getDefs (src )
19
19
local requiresKeys = {}
20
+ local isClass = false
20
21
for _ , def in ipairs (defs ) do
21
22
if def .type == ' doc.class' then
22
23
if not def .fields then
23
24
goto continue
24
25
end
25
26
if def .bindSource then
26
27
if guide .isInRange (def .bindSource , src .start ) then
27
- goto continue
28
+ isClass = true
29
+ break
28
30
end
29
31
end
30
32
for _ , field in ipairs (def .fields ) do
@@ -41,7 +43,7 @@ return function (uri, callback)
41
43
:: continue::
42
44
end
43
45
44
- if # requiresKeys == 0 then
46
+ if # requiresKeys == 0 or isClass then
45
47
return
46
48
end
47
49
Original file line number Diff line number Diff line change @@ -2414,3 +2414,20 @@ f {
2414
2414
z = 3,
2415
2415
}
2416
2416
]]
2417
+
2418
+ TEST [[
2419
+ ---@diagnostic disable: unused-local
2420
+ ---@class A
2421
+ ---@field x number
2422
+ local t = {}
2423
+ ]]
2424
+
2425
+ TEST [[
2426
+ ---@diagnostic disable: unused-local
2427
+
2428
+ ---@class A
2429
+ ---@field x number
2430
+
2431
+ ---@class A
2432
+ local t = {}
2433
+ ]]
You can’t perform that action at this time.
0 commit comments