diff --git a/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_json.py b/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_json.py index 37bbd5678..47a8e2e4d 100644 --- a/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_json.py +++ b/src/debugpy/_vendored/pydevd/_pydevd_bundle/pydevd_net_command_factory_json.py @@ -316,6 +316,7 @@ def make_thread_suspend_single_notification(self, py_db, thread_id, stop_reason) thread = pydevd_find_thread_by_id(thread_id) info = set_additional_thread_info(thread) + preserve_focus_hint = False if stop_reason in self._STEP_REASONS: if info.pydev_original_step_cmd == CMD_STOP_ON_START: @@ -334,6 +335,7 @@ def make_thread_suspend_single_notification(self, py_db, thread_id, stop_reason) stop_reason = 'goto' else: stop_reason = 'pause' + preserve_focus_hint = True if stop_reason == 'exception': exception_info_response = build_exception_info_response( @@ -349,7 +351,7 @@ def make_thread_suspend_single_notification(self, py_db, thread_id, stop_reason) threadId=thread_id, text=exc_name, allThreadsStopped=True, - preserveFocusHint=stop_reason not in ['step', 'exception', 'breakpoint', 'entry', 'goto'], + preserveFocusHint=preserve_focus_hint, ) event = pydevd_schema.StoppedEvent(body) return NetCommand(CMD_THREAD_SUSPEND_SINGLE_NOTIFICATION, 0, event, is_json=True) diff --git a/src/debugpy/adapter/clients.py b/src/debugpy/adapter/clients.py index ed2e33336..c703c6106 100644 --- a/src/debugpy/adapter/clients.py +++ b/src/debugpy/adapter/clients.py @@ -164,6 +164,7 @@ def initialize_request(self, request): "supportsEvaluateForHovers": True, "supportsExceptionInfoRequest": True, "supportsExceptionOptions": True, + "supportsFunctionBreakpoints": True, "supportsHitConditionalBreakpoints": True, "supportsLogPoints": True, "supportsModulesRequest": True,