File tree Expand file tree Collapse file tree 3 files changed +19
-0
lines changed
Expand file tree Collapse file tree 3 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 11# changelog
22
33## 3.7.0
4+ * ` NEW ` support ` ---@type ` and ` --[[@as]] ` for return statement
45* ` FIX ` wrong hover and signature for method with varargs and overloads
56* ` FIX ` [ #2224 ]
67
Original file line number Diff line number Diff line change @@ -1168,6 +1168,16 @@ local compilerSwitch = util.switch()
11681168 vm .compileCallArg (source , call )
11691169 end
11701170
1171+ if source .parent .type == ' return' then
1172+ local myIndex = util .arrayIndexOf (source .parent , source )
1173+ --- @cast myIndex -?
1174+ local parentNode = vm .selectNode (source .parent , myIndex )
1175+ if not parentNode :isEmpty () then
1176+ vm .setNode (source , parentNode )
1177+ return
1178+ end
1179+ end
1180+
11711181 if source .parent .type == ' setglobal'
11721182 or source .parent .type == ' local'
11731183 or source .parent .type == ' setlocal'
Original file line number Diff line number Diff line change @@ -197,3 +197,11 @@ local b = {
197197 c = 3,
198198}
199199]]
200+
201+ TEST [[
202+ ---@class A
203+ ---@field x integer
204+
205+ ---@type A
206+ return <!{}!>
207+ ]]
You can’t perform that action at this time.
0 commit comments