Skip to content

Unable to debug typescript directly #2307

@plgleigh

Description

@plgleigh

Describe the bug
When I set "program" to a typescript file, the debugger tries to find the compiled output and if it manages to, overwrites the value with the found javascript file.

Relevant code is here. Apparently related issue is #291.

This is completely undocumented and unexpected. Looking at the code, there doesn't seem to be any way to disable this behavior. Even if the predictor isn't sure what the source is (it finds multiple candidates), it just picks the first one.

If I set the program to a typescript file, it's because I want to debug the typescript file. If there happens to be built output there, it's probably out of date. It's not at all obvious that the old built code is being executed instead of the fresh source.

The original assumptions no longer apply, since Node itself can run typescript. Even at the time, it was noted that other runtime possibilities exist, but the code does not check the runtime value.

To Reproduce
Steps to reproduce the behavior:

  1. Create a launch config with "program" set to a typescript file
  2. Compile the typescript file with sourcemaps
  3. Start debugging
  4. The debugger substitutes the program value with the built path instead

VS Code Version:
1.107.1 (Universal)
Commit: 994fd12f8d3a5aa16f17d42c041e5809167e845a

Metadata

Metadata

Assignees

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions