Description
Test for #6915:
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
[-]Test globbing support for the `outdir` attribute in the launch config[/-][+]Test globbing support for the `outFiles` attribute in the launch config[/+]Tyriar commentedon Sep 27, 2016
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.roblourens commentedon Sep 27, 2016
@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 commentedon Sep 27, 2016
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
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.
3 remaining items