Merge pull request #51 from karthiknadig/bugs

Removes ptvsd threads from the threads list.
This commit is contained in:
Karthik Nadig 2018-02-12 10:28:24 -08:00 committed by GitHub
commit 0ea43968d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -455,6 +455,9 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel):
}
self.send_event('process', **evt)
def is_debugger_internal_thread(self, thread_name):
return thread_name and (thread_name.startswith('pydevd.') or thread_name.startswith('ptvsd.'))
@async_handler
def on_threads(self, request, args):
# TODO: docstring
@ -473,7 +476,7 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel):
name = unquote(xthread['name'])
except KeyError:
name = None
if not (name and name.startswith('pydevd.')):
if not self.is_debugger_internal_thread(name):
threads.append({'id': tid, 'name': name})
self.send_response(request, threads=threads)
@ -724,7 +727,12 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel):
# TODO: docstring
xml = untangle.parse(args).xml
tid = self.thread_map.to_vscode(xml.thread['id'])
self.send_event('thread', reason='started', threadId=tid)
try:
name = unquote(xml.thread['name'])
except KeyError:
name = None
if not self.is_debugger_internal_thread(name):
self.send_event('thread', reason='started', threadId=tid)
@pydevd_events.handler(pydevd_comm.CMD_THREAD_KILL)
def on_pydevd_thread_kill(self, seq, args):