File tree Expand file tree Collapse file tree 2 files changed +21
-2
lines changed
Expand file tree Collapse file tree 2 files changed +21
-2
lines changed Original file line number Diff line number Diff line change @@ -152,12 +152,29 @@ function M.step()
152152 table.insert (state ._suspended and M ._suspended or M ._active , state )
153153 end
154154
155- -- print("step", #M._active, #M._suspended )
155+ -- M.debug( )
156156 if # M ._active == 0 then
157157 return M ._executor :stop ()
158158 end
159159end
160160
161+ function M .debug ()
162+ local lines = {
163+ " - active: " .. # M ._active ,
164+ " - suspended: " .. # M ._suspended ,
165+ }
166+ for _ , async in ipairs (M ._active ) do
167+ local info = debug.getinfo (async ._fn )
168+ local file = vim .fn .fnamemodify (info .short_src :sub (1 ), " :~:." )
169+ table.insert (lines , (" %s:%d" ):format (file , info .linedefined ))
170+ if # lines > 10 then
171+ break
172+ end
173+ end
174+ local msg = table.concat (lines , " \n " )
175+ M ._notif = vim .notify (msg , nil , { replace = M ._notif })
176+ end
177+
161178--- @param async Async
162179function M .add (async )
163180 table.insert (M ._active , async )
Original file line number Diff line number Diff line change @@ -153,7 +153,9 @@ function Runner:_start()
153153 end
154154 continue (true )
155155 end
156- coroutine.yield ()
156+ if active > 0 then
157+ self ._running :suspend ()
158+ end
157159 end
158160end
159161
You can’t perform that action at this time.
0 commit comments