Skip to content
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 for "Friendly Call Frames" in call stack, like Chrome's devtools #2054

Open
joshtynjala opened this issue Aug 8, 2024 · 1 comment
Assignees
Labels
feature-request Request for new features or functionality
Milestone

Comments

@joshtynjala
Copy link

The debugger in Chrome browser's devtools has a feature called "Friendly Call Frames" that renders the call stack using the original/unminified function names, if those name mappings are defined at a specific location in a source map (.js.map) file. This provides a better developer experience than rendering minified or obfuscated function names. It would be great to have this feature in vscode-js-debug too.

I'll just copy the description from babel/babel#14907 because it describes how the feature works very well.

Before:
image

After:
image

To unminify a frame, you need to have a name attached to the ( of the declaration site. So, we need to have a name:

function foo() {
//          ^ Here
  bar(baz);
}

function bar(callback) {
//          ^ Here
  callback();
}

function baz() {
//          ^ Here
  throw new Error('test');
}

foo();

It doesn't matter that we've properly named the bar/callback/Error/foo identifiers at before the (, the segment that includes the ( must also include it.

@joshtynjala joshtynjala added the feature-request Request for new features or functionality label Aug 8, 2024
@connor4312
Copy link
Member

Seems sensible 👍

@connor4312 connor4312 added this to the On Deck milestone Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

2 participants