microsoft / microsoft/vscode-js-debug
Feature Request: Source-Map/Source Out Of Sync Detection
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2k
- Forks
- 373
- Avg merge
- 1d 9m
- Merged PRs (30d)
- 6
Description
Many people don't trust source maps (@alexdima), so they always prefer stepping through the transpiled JS to rule out a bunch of issues.
These issues include:
tsc/webpack/gulpdies silently. You change a TypeScript file, restart/reload your app/test/website and debug again. However, the executed JavaScript source code no longer matches the TypeScript source code. You think you fixed the bug, step through the fixed code, but it is still broken and nothing makes sense anymore.tsc/webpack/gulpis too slow: You reload/restart before your build tool is finished. This causes the same issues as described in 1.- You use some hot-reload technology (like webpack HMR) that allows to load different (i.e. updated) JavaScript modules that map to the same TypeScript file path. It can happen that you step through both the new and the old module. Currently, you will see the same TypeScript file which is clearly problematic when stepping through code provided by the old module.
It would be really nice if vscode-js-debug detects if the file on disk is in sync with the code that is being executed, i.e. if the source map still applies.
If they aren't in sync anymore, vscode-js-debug should either step through the js code ignoring the source map, or, if the TypeScript code is inlined into the source map, show a read-only editor of the TypeScript code at the time of the transpilation.
Maybe this can even be combined with a diff view.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by tracing the existing source-map handling in vscode-js-debug and how executed JavaScript is associated with TypeScript files. Define how out-of-sync files should be detected and whether the result should ignore the source map, show the transpilation-time TypeScript, or provide a diff view; the issue names no files or tests.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, webpack
- Domain
- devtools
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100