-
Notifications
You must be signed in to change notification settings - Fork 30.2k
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
Custom Object Formatter for debugger #26234
Comments
Yeah I've seen that, but it doesn't seem to have gotten a lot of traction. And might be an awkward fit into the vscode way of doing things. |
Let's keep this open as a feature request |
This is pretty essential to working with immutablejs: https://github.com/andrewdavey/immutable-devtools |
Also would be useful for working with MobX: https://github.com/motion/mobx-formatters |
Investigating this. Looks like this is where the action happens: Edit: this probably should happen in the vscode-chrome-debug repo |
Then here is the code for immutable formatters: |
Also useful for https://github.com/emmanueltouzery/prelude-ts |
|
Adding another use-case: BuckleScript, compiling OCaml to JavaScript. The internal representation of runtime values is very OCaml-specific; but they have a Chrome formatter to aid debugging in Chrome. It'd be really nice to be able to actually use VScode for debugging BuckleScript projects. /= |
I've investigated Custom Object Formatters (aka COF or Human Readable Objects) across different language environments/runtimes and here are the results:
Custom Object Formatters in generic debuggers:
For VS Code the fundamental question is: IMO the answer is "no": COF needs to be done in debug extensions. Here is why:
The verdict: I recommend that we add support for the Chrome DevTools COFs to the "Debugger for Chrome". I will create a corresponding feature request. |
This issue is being closed to keep the number of issues in our inbox on a manageable level, we are closing issues that are not going to be addressed in the foreseeable future: We look at the number of votes the issue has received and the number of duplicate issues filed. More details here. If you disagree and feel that this issue is crucial: We are happy to listen and to reconsider. If you wonder what we are up to, please see our roadmap and issue reporting guidelines. Thanks for your understanding and happy coding! |
Hi @weinand - I'm having trouble following the issue chain for this use case. #46829 (which was JS-specific) was closed in favor of this issue which is more generic. But this issue punts the ball back to each language's debugger. Is there a new issue to replace #46829 for the JS debugger? I'm asking because I'm part of the team that's working on the polyfill for the soon-to-be-Stage3 JS Temporal proposal and we'd like a good way to show a text representation of Temporal objects in the VSCode debugger. My understanding of Chrome's Custom Object Formatters is that they need to be installed on the debugging-console side and opted into by every user, as opposed to letting library authors to control their own objects' string representation in the debugger. The latter is what we are looking for. |
@justingrant yes, you are right: our investigation in this issue showed that Custom Object Formatters need to be implemented by individual debug extensions, but consequently we should reopen #46829 . |
Wondering if it's possible to have Custom Object Formatter for debugger, since v8 inspector protocol now supports that.
Chrome DevTools now has it: https://medium.com/@paul_irish/debugging-node-js-nightlies-with-chrome-devtools-7c4a1b95ae27
@roblourens
The text was updated successfully, but these errors were encountered: