-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Ask debug adapter for raw strings #14501
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Codecov Report
@@ Coverage Diff @@
## release-2020.10 #14501 +/- ##
================================================
Coverage 59.19% 59.19%
================================================
Files 721 721
Lines 40228 40228
Branches 5828 5828
================================================
Hits 23811 23811
Misses 15155 15155
Partials 1262 1262
Continue to review full report at Codecov.
|
return _VSCODE_json.dumps(result) | ||
stringified = _VSCODE_json.dumps(result) | ||
# use `encode` to obtain a bytestring for increased portability | ||
return stringified.encode() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These files are used in the normal case too. (Jupyter kernel I mean). There were no changes required there as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was testing and noticed this broke variable explorer, as values come back from Jupyter with a 'b' in front (bytestring) which is not JSON parseable. Just reverted this. It's not strictly required, just recommended by Pavel, and we should probably still do this properly, just not needed now.
32ad978
to
e3a1cd0
Compare
Kudos, SonarCloud Quality Gate passed!
|
For https://github.com/microsoft/vscode-python/issues/14441
With our previous custom evaluate request, debugpy was returning the result of calling
repr()
on our variable value, which is what caused the extra backslashes. By sending "format": "rawString" with our request (implemented as a VS extension: https://github.com/microsoft/VSDebugAdapterHost/wiki/Stack-Trace-and-Value-Formatting), debugpy returns us the raw stringified JSON object, which we can then parse as JSON. The alternative would've been to parse Python string literals ourselves.package-lock.json
has been regenerated by runningnpm install
(if dependencies have changed).