Skip to content

Commit

Permalink
Fix corner case when both threadId and allThreadsStopped are set
Browse files Browse the repository at this point in the history
  • Loading branch information
JafarAbdi authored and mfussenegger committed Jun 5, 2022
1 parent 9c783d8 commit 688cb52
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lua/dap/session.lua
Expand Up @@ -526,10 +526,7 @@ function Session:event_stopped(stopped)
self.stopped_thread_id = stopped.threadId
end

if stopped.threadId then
progress.report('Thread stopped: ' .. stopped.threadId)
self.threads[stopped.threadId].stopped = true
elseif stopped.allThreadsStopped then
if stopped.allThreadsStopped then
progress.report('All threads stopped')
utils.notify(
'All threads stopped. ' .. stopped.reason and 'Reason: ' .. stopped.reason or '',
Expand All @@ -538,6 +535,9 @@ function Session:event_stopped(stopped)
for _, thread in pairs(self.threads) do
thread.stopped = true
end
elseif stopped.threadId then
progress.report('Thread stopped: ' .. stopped.threadId)
self.threads[stopped.threadId].stopped = true
else
utils.notify('Stopped event received, but no threadId or allThreadsStopped', vim.log.levels.WARN)
end
Expand Down

0 comments on commit 688cb52

Please sign in to comment.