File tree 3 files changed +27
-4
lines changed
3 files changed +27
-4
lines changed Original file line number Diff line number Diff line change 12
12
* ` FIX ` [ #1141 ] ( https://github.com/sumneko/lua-language-server/issues/1141 )
13
13
* ` FIX ` [ #1144 ] ( https://github.com/sumneko/lua-language-server/issues/1144 )
14
14
* ` FIX ` [ #1150 ] ( https://github.com/sumneko/lua-language-server/issues/1150 )
15
+ * ` FIX ` [ #1155 ] ( https://github.com/sumneko/lua-language-server/issues/1155 )
15
16
16
17
## 3.2.3
17
18
` 2022-5-16 `
Original file line number Diff line number Diff line change @@ -279,10 +279,22 @@ local function searchByDef(source, pushResult)
279
279
defMap [source ] = true
280
280
return defMap
281
281
end
282
- local defs = vm .getDefs (source )
283
- for _ , def in ipairs (defs ) do
284
- pushResult (def )
285
- defMap [def ] = true
282
+ if source .type == ' field'
283
+ or source .type == ' method' then
284
+ source = source .parent
285
+ end
286
+ defMap [source ] = true
287
+ if guide .isSet (source ) then
288
+ local defs = vm .getDefs (source )
289
+ for _ , def in ipairs (defs ) do
290
+ pushResult (def )
291
+ end
292
+ else
293
+ local defs = vm .getDefs (source )
294
+ for _ , def in ipairs (defs ) do
295
+ pushResult (def )
296
+ defMap [def ] = true
297
+ end
286
298
end
287
299
return defMap
288
300
end
Original file line number Diff line number Diff line change @@ -184,3 +184,13 @@ local <~t~>
184
184
-- b.<~x~> = 1
185
185
-- c.<!x!> = 1
186
186
-- ]]
187
+
188
+ TEST [[
189
+ ---@class a
190
+ local a = { }
191
+ ---@class b
192
+ local b = { }
193
+
194
+ a.color = { 1, 1, 1 }
195
+ b.<~color~> = a.color
196
+ ]]
You can’t perform that action at this time.
0 commit comments