File tree 2 files changed +29
-0
lines changed
2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,8 @@ mt._isLocal = false
20
20
21
21
vm .NULL = setmetatable ({}, mt )
22
22
23
+ local LOCK = {}
24
+
23
25
local inferSorted = {
24
26
[' boolean' ] = - 100 ,
25
27
[' string' ] = - 99 ,
@@ -218,6 +220,10 @@ function mt:_eraseAlias(uri)
218
220
local expandAlias = config .get (uri , ' Lua.hover.expandAlias' )
219
221
for n in self .node :eachObject () do
220
222
if n .type == ' global' and n .cate == ' type' then
223
+ if LOCK [n .name ] then
224
+ goto CONTINUE
225
+ end
226
+ LOCK [n .name ] = true
221
227
for _ , set in ipairs (n :getSets (uri )) do
222
228
if set .type == ' doc.alias' then
223
229
if expandAlias then
@@ -239,6 +245,8 @@ function mt:_eraseAlias(uri)
239
245
end
240
246
end
241
247
end
248
+ LOCK [n .name ] = nil
249
+ :: CONTINUE::
242
250
end
243
251
end
244
252
return drop
Original file line number Diff line number Diff line change @@ -2491,3 +2491,24 @@ end
2491
2491
2492
2492
print(<?x?>)
2493
2493
]]
2494
+
2495
+ TEST ' table<unknown, true>' [[
2496
+ ---@alias xxx table<xxx, true>
2497
+
2498
+ ---@type xxx
2499
+ local <?t?>
2500
+ ]]
2501
+
2502
+ TEST ' unknown[][]' [[
2503
+ ---@alias xxx xxx[]
2504
+
2505
+ ---@type xxx
2506
+ local <?t?>
2507
+ ]]
2508
+
2509
+ TEST ' fun(x: fun(x: unknown))' [[
2510
+ ---@alias xxx fun(x: xxx)
2511
+
2512
+ ---@type xxx
2513
+ local <?t?>
2514
+ ]]
You can’t perform that action at this time.
0 commit comments