-
Notifications
You must be signed in to change notification settings - Fork 28.8k
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
DAP errors when setting breakpoints are not respected #89059
Comments
Fixes #226. As suggested in the original issue, we use the TS parser to parse the code inside the {} 'blocks', which lets us handle more complex expressions. We also now support multiple statements, and (try to) return the last one, and log the stacks of any thrown errors rather than silently failing. Finally, we return a verbose error to the user in the event that their logpoint isn't valid JS, though there's an issue with VS Code right now: microsoft/vscode#89059
you can verify this by pulling down the branch in the linked PR, and then setting a logpoint like |
* feat: make logpoint parsing more resilient Fixes #226. As suggested in the original issue, we use the TS parser to parse the code inside the {} 'blocks', which lets us handle more complex expressions. We also now support multiple statements, and (try to) return the last one, and log the stacks of any thrown errors rather than silently failing. Finally, we return a verbose error to the user in the event that their logpoint isn't valid JS, though there's an issue with VS Code right now: microsoft/vscode#89059 * fixup! pr comments
@connor4312 Thanks for filling this issue. Please try it out and let me know how it behaves. Thank you! |
Hm, I see the error now shown property in the console log of the workbench... But I don't see any message displayed to me. This is the full request/response: {
"command": "setBreakpoints",
"arguments": {
"source": {
"name": "main.js",
"path": "/Users/copeet/Github/vscode-pwa/demos/node/main.js",
"sourceReference": 0
},
"lines": [
23
],
"breakpoints": [
{
"line": 23,
"logMessage": "hello {'world}"
}
],
"sourceModified": false
},
"type": "request",
"seq": 12
}
{
"seq": 117,
"type": "response",
"request_seq": 12,
"command": "setBreakpoints",
"success": false,
"body": {
"error": {
"id": 9231,
"format": "Invalid or unexpected token",
"showUser": true
}
}
} |
Nevermind, I was behind on insiders, I had to restart twice to get the very latest version. It works here :) |
Thanks for verifying and leting me know! |
I wanted to validate logpoint breakpoint syntax in js-debug when setting the breakpoint. Plenty of times I have tried setting a breakpoint and only later realized it didn't get hit because I was missing a quotation mark. However it appears that errors in
setBreakpoints
aren't handled. I send back this error:It doesn't get shown to the user, and I see this in the window log:
The text was updated successfully, but these errors were encountered: