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

Feature request: Use TypeScript breakpoints for a debug session of a JavaScript file with source maps #972

Closed
AndrewFerr opened this issue Nov 21, 2022 · 6 comments

Comments

@AndrewFerr
Copy link
Member

If a JavaScript file has a source map that refers to a TypeScript file, it would be nice if debug sessions for the JavaScript file (launched via Debug As > Node program) would pause on breakpoints set on the mapped TypeScript file. Currently, doing so has WWD ignore breakpoints on the TypeScript file.

This feature would be analogous to running node --inspect-brk on a JavaScript file & attaching to it.

This would also alleviate WWD's reliance on a tsconfig.json file to debug a TypeScript file: instead of needing a tsconfig.json to map a TypeScript file to its corresponding JavaScript (and to figure out which JavaScript file to launch with Node), WWD could use source maps to map a JavaScript file to its corresponding TypeScript file (which has the added bonus of knowing right away which file to launch with Node, as it's a JavaScript file in the first place).

@mickaelistria
Copy link
Contributor

I would consider it as a bug instead of a feature request.
Can you please share a minimal project and minimal steps to reproduce this issue?

@AndrewFerr
Copy link
Member Author

AndrewFerr commented Nov 21, 2022

Minimal project structure is a tsconfig.json of:

{
  "compilerOptions": {
    "sourceMap": true,
    "outDir": "lib",
    "rootDir": "src"
  }
}

and a single *.ts file in ./src. Build it with tsc -b (via npx or yarn as needed); put a breakpoint on it somewhere; and debug its corresponding *.js file in ./lib with Debug As > Node program.

@vrubezhny
Copy link
Contributor

I believe this issue is fixed wiith #1064

Please,update WWD from the latest snapshots. Feel free to reopen if this is still a relevant issue. Thanks

@AndrewFerr
Copy link
Member Author

No, the original issue is still present, even with the latest updates applied (including the fix for #973).

But I realize now that my reproduction steps were incorrect; I've updated them appropriately.

@AndrewFerr
Copy link
Member Author

Also, it appears that I don't have the ability to reopen issues in this repo, so please reopen this when you have a chance.

@mickaelistria mickaelistria reopened this Feb 28, 2023
@mickaelistria
Copy link
Contributor

I think this is fixed with #1174

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants