Skip to content

Commit

Permalink
Fix focus hint on function breakpoint, set supportsFunctionBreakpoint…
Browse files Browse the repository at this point in the history
…s on the debugpy side.
  • Loading branch information
fabioz committed Jul 15, 2021
1 parent d7970b8 commit 75e5058
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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(
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions src/debugpy/adapter/clients.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ def initialize_request(self, request):
"supportsEvaluateForHovers": True,
"supportsExceptionInfoRequest": True,
"supportsExceptionOptions": True,
"supportsFunctionBreakpoints": True,
"supportsHitConditionalBreakpoints": True,
"supportsLogPoints": True,
"supportsModulesRequest": True,
Expand Down

0 comments on commit 75e5058

Please sign in to comment.