Skip to content

Conversation

@StephenRedd
Copy link
Contributor

@StephenRedd StephenRedd commented May 1, 2017

Overview

This adds two new launch configs and a compound config for debugging the client typescript.

There is a LOT going on with VS Code right now, and there has been a lot of instability in general around both .NET core and Typescript debugging. Make sure your C# extension is up to date, and if you have trouble consider installing a pre-release if one is available.

Either way though, the debugging experience when you try to mix typescript and .net core debugging is fairly rough right now, but a lot of effort is going into making that work much smoother over the next few months.

launch configs

"[Development] Debug TypeScript" launches a browser for debugging via the chrome debug extensions. Assumes the server is already running. The key here seems to be specifying the sourceMapPathOverrides setting instead of letting it use the default paths.

needs testing with linux / osx; I'm not sure the sourceMapPathOverrides is quite right for other OSes.

"[Development] Launch Server (no browser)" launches the asp.net core server, but does not open a browser. Intended for use with multi-target debugging in VS Code. Pretty much the same as the existing one, just doesn't open a browser automatically

"[Development] Debug Server & Client" this is a compound debugger configuration that starts both of the above configurations in parallel.

Start multi-target debugging manually:

  • In VS Code, select the "[Development] Launch Server (no browser)" config and start debugging.
  • Wait until the server has had a few seconds to spin up
  • Switch VS Code to the "[Development] Debug TypeScript" configuration and start debugging

The debug bar in VS Code will show two debugger configs and give you a drop down to switch between them. You can set breakpoints for server or client code.

Using the compound config

The "[Development] Debug Server & Client" config starts debuggers for both the server and client configs at the same time. This is not the smoothest experience since the client config will try to open the browser before the server process is running. Keep refreshing the browser window and it should bring up the page as soon as the server is online.

@StephenRedd
Copy link
Contributor Author

StephenRedd commented May 1, 2017

I would like some guidance on naming of the configs, especially if you want to leave the compound config in there... can be confusing.

The compound config is a really poor experience, especially for devs without much previous experience with vs code... might be better to leave it out.

Either way, a bit of readme might help people get started; I can write that up but I wanted to wait until the config gets review and feedback first.

@MarkPieszak
Copy link
Member

This looks great, let me take a look and run through it later today or tomorrow!
Thank you @StephenRedd 💯

@MarkPieszak MarkPieszak merged commit 98f1948 into TrilonIO:master May 17, 2017
@StephenRedd StephenRedd deleted the typescript-debug branch June 11, 2017 17:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants