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

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

Closed
3 tasks done
weinand opened this issue Sep 19, 2016 · 3 comments
Closed
3 tasks done

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

weinand opened this issue Sep 19, 2016 · 3 comments

Comments

@weinand
Copy link
Contributor

weinand commented Sep 19, 2016

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).
@weinand weinand added this to the September 2016 milestone Sep 19, 2016
@weinand weinand self-assigned this Sep 19, 2016
@weinand weinand 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 Sep 22, 2016
@weinand weinand removed their assignment Sep 22, 2016
@Tyriar
Copy link
Member

Tyriar commented 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.

@Tyriar Tyriar removed their assignment Sep 27, 2016
@roblourens
Copy link
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
Copy link
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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants