Skip to content

Test globbing support for the outFiles attribute in the launch config #12254

Closed
@weinand

Description

@weinand
Contributor

Test for #6915:

  • Windows - @roblourens
    OS X - @ramya-rao-a
    Linux - @Tyriar

Complexity 3

When debugging transpiled code (e.g. TypeScript) and the build process generates the JavaScript code into a specific directory, it is necessary to help the node debugger finding this generated code. In previous version of VS Code this was done by specifying the root directory of the generated code via the outDir attribute.

In this release it is now possible to use multiple glob patterns for including and excluding files from the set of generated JavaScript files. For this a new array typed attribute outFiles has been introduced. The old outDir is still supported, but we plan to deprecated this in the future.

The following example shows how to configure source maps if the generated code lives in an "out" and "node_modules" directory and you want to exclude the generated test code:

  "sourceMaps": true,
  "outFiles": [
    "${workspaceRoot}/{out,node_modules}/**/*.js",
    "!${workspaceRoot}/out/tests/**/*.js"
  ]

Verify this feature with an 'interesting' source map setup as follows:

  • launch a debug session
  • as long as outFiles hasn't been configured, setting a breakpoint in source should result in an unverified (grey) breakpoint because node-debug cannot find the corresponding generated code (which should have a 'sourceMappingURL' that points to the source via a source map).
  • configure the outFiles attribute and restart debug session
  • now the breakpoint should verify (and should be hit).

Activity

added this to the September 2016 milestone on Sep 19, 2016
self-assigned this
on Sep 19, 2016
changed the title [-]Test globbing support for the `outdir` attribute in the launch config[/-] [+]Test globbing support for the `outFiles` attribute in the launch config[/+] on Sep 22, 2016
removed their assignment
on Sep 22, 2016
Tyriar

Tyriar commented on Sep 27, 2016

@Tyriar
Member

outFiles seemed to work fine but I could not get the breakpoints to be unverified. The js file specifies the source map which specifies the ts file so I'm not sure under which circumstances a breakpoint could be unverified.

removed their assignment
on Sep 27, 2016
roblourens

roblourens commented on Sep 27, 2016

@roblourens
Member

@Tyriar If outFiles/outDir isn't present and the breakpoint is set before the js file is loaded, would be one case.

ramya-rao-a

ramya-rao-a commented on Sep 27, 2016

@ramya-rao-a
Contributor

if the generated files are in a folder called "out" in the workspace, then debugging (and verified brakpoints) works even if no outdir/outFiles are set. That's by design?

@weinand If the outFiles is not configured, then we would see the

Cannot launch program '...', setting the 'outDir' attribute might help.

To test the unverified breakpoints, we (Rob and I) had to have multiple typescript files, have the one from where the program launches configured to be reachable via outFiles and others with breakpoints to be unreachable. Then we could see the unverified breakpoints.

removed their assignment
on Sep 27, 2016

3 remaining items

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @roblourens@weinand@Tyriar@chrmarti@ramya-rao-a

        Issue actions

          Test globbing support for the `outFiles` attribute in the launch config · Issue #12254 · microsoft/vscode