Skip to content
This repository has been archived by the owner on Aug 2, 2023. It is now read-only.

Commit

Permalink
Fix for breakpoint binding issue in VS (#1601)
Browse files Browse the repository at this point in the history
* Fix for breakpoint binding issue in VS

* Fix tests
  • Loading branch information
karthiknadig committed Jul 17, 2019
1 parent 12ea929 commit 0e173e9
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -504,13 +504,13 @@ def on_setbreakpoints_request(self, py_db, request):
error_msg = 'Breakpoint not validated (reason unknown -- please report as bug).'

breakpoints_set.append(pydevd_schema.Breakpoint(
verified=False, line=result.translated_line, message=error_msg).to_dict())
verified=False, line=result.translated_line, message=error_msg, source=arguments.source).to_dict())
else:
# Note that the id is made up (the id for pydevd is unique only within a file, so, the
# line is used for it).
# Also, the id is currently not used afterwards, so, we don't even keep a mapping.
breakpoints_set.append(pydevd_schema.Breakpoint(
verified=True, id=self._next_breakpoint_id(), line=result.translated_line).to_dict())
verified=True, id=self._next_breakpoint_id(), line=result.translated_line, source=arguments.source).to_dict())

body = {'breakpoints': breakpoints_set}
set_breakpoints_response = pydevd_base_schema.build_response(request, kwargs={'body': body})
Expand Down
4 changes: 3 additions & 1 deletion tests/func/test_breakpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -417,7 +417,9 @@ def code_to_debug():
assert breakpoints == [{
'verified': False,
'message': 'Breakpoint in file that does not exist.',
'source': {},
'source': ANY.dict_with({
'path': Path('invalid_file.py')
}),
'line': 1
}]

Expand Down
4 changes: 3 additions & 1 deletion tests/func/test_exclude_rules.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,9 @@ def call_func():
'Breakpoint in file excluded by filters.\n'
'Note: may be excluded because of "justMyCode" option (default == true).'
),
'source': {},
'source': ANY.dict_with({
'path': Path(code_to_debug)
}),
'line': 1
}]

Expand Down

0 comments on commit 0e173e9

Please sign in to comment.