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

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

Open
connor4312 opened this issue Feb 24, 2022 · 1 comment
Open

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

connor4312 opened this issue Feb 24, 2022 · 1 comment
Assignees
Labels
feature-request Request for new features or functionality
Milestone

Comments

@connor4312
Copy link
Member

connor4312 commented Feb 24, 2022

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

@isidorn
Copy link

isidorn commented Feb 25, 2022

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

@joaomoreno joaomoreno changed the title Implement a "test run" to automatically configure a launch.json Implement a "dry run" to automatically configure a launch.json Jun 8, 2022
@joaomoreno joaomoreno added this to the June 2022 milestone Jun 8, 2022
@connor4312 connor4312 modified the milestones: June 2022, July 2022 Jun 29, 2022
@connor4312 connor4312 modified the milestones: July 2022, On Deck Jul 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants