From 313cb04bbbb950f113c74c47737f5bf515de35ab Mon Sep 17 00:00:00 2001 From: Karthik Nadig Date: Mon, 19 Mar 2018 20:47:42 -0700 Subject: [PATCH] Add supportsSetExpression to tests. --- debugger_protocol/messages/_requests.py | 1 + ptvsd/wrapper.py | 6 +++--- tests/highlevel/test_lifecycle.py | 2 ++ tests/highlevel/test_live_pydevd.py | 1 + tests/highlevel/test_messages.py | 1 + 5 files changed, 8 insertions(+), 3 deletions(-) diff --git a/debugger_protocol/messages/_requests.py b/debugger_protocol/messages/_requests.py index c696528b..edb018b0 100644 --- a/debugger_protocol/messages/_requests.py +++ b/debugger_protocol/messages/_requests.py @@ -79,6 +79,7 @@ class Capabilities(FieldsNamespace): Field('supportTerminateDebuggee', bool), Field('supportsDelayedStackTraceLoading', bool), Field('supportsLoadedSourcesRequest', bool), + Field('supportsSetExpression', bool), ] diff --git a/ptvsd/wrapper.py b/ptvsd/wrapper.py index 371be48a..9e2f148f 100644 --- a/ptvsd/wrapper.py +++ b/ptvsd/wrapper.py @@ -312,7 +312,7 @@ class PydevdSocket(object): def pydevd_notify(self, cmd_id, args): # TODO: docstring - seq, s = self.make_packet(cmd_id, args) + _, s = self.make_packet(cmd_id, args) os.write(self.pipe_w, s.encode('utf8')) def pydevd_request(self, loop, cmd_id, args): @@ -627,6 +627,7 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel): supportsExceptionOptions=True, supportsEvaluateForHovers=True, supportsValueFormattingOptions=True, + supportsSetExpression=True, exceptionBreakpointFilters=[ { 'filter': 'raised', @@ -979,7 +980,6 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel): if context == 'repl' and is_eval_error == 'True': # try exec for repl requests - cmd_args = (pyd_tid, pyd_fid, 'LOCAL', expr, '1') _, _, resp_args = yield self.pydevd_request( pydevd_comm.CMD_EXEC_EXPRESSION, msg) @@ -1254,7 +1254,7 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel): @pydevd_events.handler(pydevd_comm.CMD_THREAD_RUN) def on_pydevd_thread_run(self, seq, args): # TODO: docstring - pyd_tid, reason = args.split('\t') + pyd_tid, _ = args.split('\t') pyd_tid = pyd_tid.strip() # Stack trace, active exception, all frames, and variables for diff --git a/tests/highlevel/test_lifecycle.py b/tests/highlevel/test_lifecycle.py index ea63bc23..ab07eded 100644 --- a/tests/highlevel/test_lifecycle.py +++ b/tests/highlevel/test_lifecycle.py @@ -70,6 +70,7 @@ class LifecycleTests(HighlevelTest, unittest.TestCase): }, ], supportsEvaluateForHovers=True, + supportsSetExpression=True, )), self.new_event('initialized'), self.new_response(req_attach), @@ -133,6 +134,7 @@ class LifecycleTests(HighlevelTest, unittest.TestCase): }, ], supportsEvaluateForHovers=True, + supportsSetExpression=True, )), self.new_event('initialized'), self.new_response(req_launch), diff --git a/tests/highlevel/test_live_pydevd.py b/tests/highlevel/test_live_pydevd.py index 787df734..8f08470b 100644 --- a/tests/highlevel/test_live_pydevd.py +++ b/tests/highlevel/test_live_pydevd.py @@ -124,6 +124,7 @@ class LifecycleTests(TestBase, unittest.TestCase): }, ], supportsEvaluateForHovers=True, + supportsSetExpression=True, )), self.new_event('initialized'), self.new_response(req_attach), diff --git a/tests/highlevel/test_messages.py b/tests/highlevel/test_messages.py index 277edb13..98ae1d36 100644 --- a/tests/highlevel/test_messages.py +++ b/tests/highlevel/test_messages.py @@ -123,6 +123,7 @@ class InitializeTests(LifecycleTest, unittest.TestCase): }, ], supportsEvaluateForHovers=True, + supportsSetExpression=True, )), self.new_event(1, 'initialized'), ])