mirror of
https://github.com/microsoft/debugpy.git
synced 2025-12-23 08:48:12 +00:00
Send a create event for each new thread found while handling on_threads request
This commit is contained in:
parent
a94d616b55
commit
5825fbf7b5
1 changed files with 11 additions and 7 deletions
|
|
@ -552,18 +552,21 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel):
|
|||
|
||||
threads = []
|
||||
for xthread in xthreads:
|
||||
try:
|
||||
tid = self.thread_map.to_vscode(xthread['id'], autogen=False)
|
||||
except KeyError:
|
||||
continue
|
||||
|
||||
try:
|
||||
name = unquote(xthread['name'])
|
||||
except KeyError:
|
||||
name = None
|
||||
|
||||
|
||||
if not self.is_debugger_internal_thread(name):
|
||||
threads.append({'id': tid, 'name': name})
|
||||
pyd_tid = xthread['id']
|
||||
try:
|
||||
vsc_tid = self.thread_map.to_vscode(pyd_tid, autogen=False)
|
||||
except KeyError:
|
||||
# This is a previously unseen thread
|
||||
vsc_tid = self.thread_map.to_vscode(pyd_tid, autogen=True)
|
||||
self.send_event('thread', reason='started', threadId=vsc_tid)
|
||||
|
||||
threads.append({'id': vsc_tid, 'name': name})
|
||||
|
||||
self.send_response(request, threads=threads)
|
||||
|
||||
|
|
@ -825,6 +828,7 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel):
|
|||
except KeyError:
|
||||
name = None
|
||||
if not self.is_debugger_internal_thread(name):
|
||||
# Any internal pydevd or ptvsd threads will be ignored everywhere
|
||||
tid = self.thread_map.to_vscode(xml.thread['id'], autogen=True)
|
||||
self.send_event('thread', reason='started', threadId=tid)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue