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

Source maps with inlined source #2183

Closed
3 tasks done
weinand opened this issue Jan 22, 2016 · 4 comments
Closed
3 tasks done

Source maps with inlined source #2183

weinand opened this issue Jan 22, 2016 · 4 comments

Comments

@weinand
Copy link
Contributor

weinand commented Jan 22, 2016

Node debugging now supports source maps with "inlined source" (Please find the definition of "inlined source" vs. "inlined source maps" below).

Here is the strategy in what situations VSCode will use "inlined source":
VSCode always tries to locate the source on disk first. If it cannot find the source (e.g. because there is none or because the paths in the source maps are broken), VSCode will use the "inlined source" if available. If there is no inlined source, VSCode will fall back to stream the file contents from node itself.

If the editor contents is not loaded by VSCode from the file system but comes from the debug adapter, the editor will be in readonly mode and the "origin" of the editor contents is shown in the editor title:

2016-01-22 16-24-31

Test: For your favourite project create source maps with inlined source.

  • verify that VSCode uses the strategy from above for showing the source
  • verify that you can step through inlined source
  • verify that breakpoints can be set in inlined source and that they are persisted
  • combine inlined source and inlined source maps and verify that still everything works.

Note: "inlined source" and "inlined source maps" are orthogonal features (and VSCode supports both either alone or in combination):

  • inlined source maps: the contents of the source map does not live in a file but is a data url at the end of the generated file
  • inlined source: the contents of the original source file does not live in a file but is included in the source map.
@weinand weinand added this to the Jan 2016 milestone Jan 22, 2016
@egamma egamma mentioned this issue Jan 23, 2016
59 tasks
@joaomoreno
Copy link
Member

This took some quite work to test... You need to debug an application that has both a file in your workspace (so you are able to set a breakpoint and thus pause the debugger) and a sourcemap'ed file which needs to appear in the call stack during that pause, otherwise you can never see it.

In order to save time for the others, here's some sample code: https://gist.github.com/joaomoreno/a1f68c4b430c8bd40d61

Simply put that in your disk, open the folder with VSCode, start debugging main.js with sourcemaps enabled. You can put a breakpoint on line 4 step in once its hit.

@weinand
Copy link
Contributor Author

weinand commented Jan 26, 2016

@joaomoreno thanks a lot! BTW, another way to test this is by enabling "stop on entry".

@joaomoreno
Copy link
Member

Ahhh forgot about that!

@aeschli
Copy link
Contributor

aeschli commented Jan 27, 2016

I verified on Linux with Joao's example

@bpasero bpasero closed this as completed Jan 28, 2016
@egamma egamma mentioned this issue Feb 1, 2016
97 tasks
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 19, 2017
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

4 participants