Skip to content

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

Open

Description

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).

Activity

  1. added
    feature-request
    on Feb 24, 2022
  2. isidorn commented on Feb 25, 2022

    @isidorn

    Good idea. Some options for discoverability:

    • We open the breakpoint title area (or breakpoint context menu) for contributions, and then js-debug could contribute an action there
    • JS-debug contributes a dynamic configuration "Auto configuration" config. The problem is what config would this auto config modify
  3. changed the title [-]Implement a "test run" to automatically configure a launch.json[/-] [+]Implement a "dry run" to automatically configure a launch.json[/+] on Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

feature-request

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions