-
Notifications
You must be signed in to change notification settings - Fork 79
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
Support a variablesReference in OutputEvent #79
Comments
/cc @roblourens |
@hbenl how would this work for node.js? VS Code does not control the implementation of @roblourens how would this work in chrome-debug or node-debug2? |
In chrome-debug, there's an event from the protocol that I listen to for log messages. I could use that in node-debug2, but I just use stdout/stderr at the moment, just because of those messages that are printed to stderr at startup, that aren't captured in the debug protocol. |
And this event represents exactly what? Every call to |
There's The second gives an |
So it sounds like this would also work for node.js. And |
More information:
A straightforward way to support console.log arguments is to add an optional array of variables to the body: {
// ...
variables: Variable[];
//...
} The UI would render only their values without their names (like Chrome dev tools): Please note: Currently VS Code is not able to render more than one tree in a row. Alternatively we could just add an optional attribute body: {
// ...
variablesReference?: number;
//...
} This would require another In this case we could treat the arguments as a single array: This would work around the problem with multiple trees in a row. But we should not make protocol design decisions based on those implementation issues. Better argument for the second approach are:
@isidorn @roblourens your opinion? |
Hm, I think I would be ok with an array, although in cases like where the it's just logging a bunch of strings, I would probably On the other hand, it might still be useful beyond |
@weinand multiple trees in one row are not currently on the horizon. Due to the above I vote for option 2. Also note that the vscode frontent can workaround option 1 and create a fake parent element because multiiple tree in one row are not supported. But this feels ugly to me. |
If we were going to have UI for it in the future, it seems like option 1 would be better so we can tell the difference between |
@roblourens in option 2 we can distinguish between |
I've added an optional attribute |
In javascript it is possible to send arbitrary objects to the console (e.g.
console.log(document.body)
). It would be useful if such an object could be inspected in the vscode debug console. Note that this is already possible for evaluation results (viaEvaluateResponse.body.variablesReference
).The text was updated successfully, but these errors were encountered: