Skip to content

Implement a "dry run" to automatically configure a launch.json #1214

Open
@connor4312

Description

@connor4312

There are two main properties of the launch.json that people get tripped up on configuring, the sourceMapPathOverrides and outFiles. Both these could be figured out with a decent degree of fidelity once the program is running, so I suggest adding a "test run" mode.

  • sourceMapPathOverrides can usually involves suffix-matching against paths from the sourcemaps, which can be overlaid and compared with the workspace. For example, ng:///src/index.ts could match src/index.ts automatically. In some cases, there might be multiple prefixes, such as webpack://package-a/src/index.ts and webpack://package-b/src/index.ts. In ambiguous cases like this, we might be able to figure things out automatically if disk sources match exactly, or interactively ask the user otherwise.

    The Chrome devtools can do something like this today, although this feature is not very widely known or used as far as I know, so I'm not sure how thorough their implementation is.

  • the webRoot/cwd follows the same logic as this too, for non-sourcemapped files.

  • outFiles can be done more simply by running the program and then generating a glob or list of globs which match all scripts containing sourcemaps that are loaded by the program, excluding those in the node_modules. In the special case when a file in the runtime has a sourcemap but its version on disk doesn't, it does not need to be included (e.g. ts-node Since latest update I'm getting "It's taking a while to configure your breakpoints." message vscode#142830 (comment))

The major question here is discoverability of this "auto configuration" mode. Perhaps it can be suggested if breakpoints don't get bound, similar to the suggester we have today (but maybe more aggressive).

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionality

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions