Skip to content

Commit eb0735f

Browse files
committed
add some delay
1 parent 9dbd786 commit eb0735f

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

script/core/diagnostics/unused-function.lua

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,11 @@ local function isValidFunction(source)
4040
return true
4141
end
4242

43+
---@async
4344
local function collect(ast, white, roots, links)
45+
---@async
4446
guide.eachSourceType(ast, 'function', function (src)
47+
await.delay()
4548
if not isValidFunction(src) then
4649
return
4750
end
@@ -95,10 +98,8 @@ return function (uri, callback)
9598
local roots = {}
9699
local links = {}
97100

98-
-- collect
99101
collect(state.ast, white, roots, links)
100102

101-
-- turn black
102103
for source in pairs(roots) do
103104
turnBlack(source, black, white, links)
104105
end

0 commit comments

Comments
 (0)