setting breakpoint angular cli .spec.ts code for debugging - karma-runner

I'm using angular2 cli and am following the test debugging instructions here official documentation. I'm able to search for the spec.ts source files which are in the app folder and set break points. However, I'm not able to do the same for the test files for components in other folder. The tests do run but I'm not able to find the source file in the chrome browser. Shall I edit some config file? I've tried to add the source files manually to the source in chrome but that doesn't help in setting the breakpoint. Any help is very much appreciated.

Do this and see what happens:
In a test that you cannot find, add a debugger; statement
Run ng test
When Karma is loaded in a new browser window, click the "Debug" button
Open the developer tools as soon as a new tab is opened in Chrome (reload the tab if you do this late)
See the "Source" devtools tab open to the file and break on the debugger statement. This should be the answer to your question.

Related

need help in VSCODE debug

I'm a VSCODE first-time user. I tried to run debug on a simple python file and was not successful. I got 2 strange results:
the debug tool bar showed and disappeared instantly
no local variables was shown in VARIABLE section
Please see the screenshot.
Anyone could give me a hint anything was missing in what I did?
You need the python vscode extension to debug a python file. When you press F5 to start debugging, a menu will ask you what you are trying to debug. Click on Python File. The python extension creates a launch.json file for you and starts the debugger.
I noticed the Run and Debug tab is in your screenshot. Click that tab above where the variables would be shown and it should ask you to create the launch.json file in order to debug the file.
Read more on debugging and launch configurations for python here: https://code.visualstudio.com/docs/python/debugging

After updating Dart its showing "Configuration ' (Flutter)' is missing in 'launch.json'."

I opened vs code and it said "Your Dart Code is Updated" to version 3.something; but after that I can't run my app it gives me error
Configuration 'NameOfApp (Flutter)' is missing in 'launch.json'.
What should i do
Goto Run in vscode then click on Add Configuration option. Thats all now you can run your app without any problem.
Check the indenting of the code inside lunch.json.
Sometimes if you copy/paste the launch.json file from another project or source you might have an extra column that breaks vs code debug process. At least that was my case!
Open VS Code>Run>Add Configuration.
now run your app! It must works fine.

Run Dart Console Application In Terminal with Visual Studio Code

I am trying to create a Dart console application that runs in the terminal rather than the Debug Console in Visual Studio Code.
Currently, when I press the play button:
It runs in the Debug Console. The problem with that is that the Debug Console cannot get user input from the line:
String userInput = stdin.readLineSync();
I know I can run the dart file from the terminal with:
dart C:\Applications\Dart\hello_world\bin\hello_world.dart
But I would prefer to use the play button out of convenience.
I found that you can edit the launch.json file to specify where it should run but it is not working. Even with the change shown in the picture below, it still runs in the debug console. In the picture you will notice a warning regarding how it only works with version from v2.7.1
I guess I was optimistic that the line "only supported for Dart SDKs from v2.7.1" was implying "SDKs from v2.7.1 and up.". However, it mostly likely means that version of the Dart SDK only.
Any help in achieving the goal of running a Dart file in the terminal using the Run button would be greatly appreciated.
If this is not possible, why would they take that functionality out of the newer Dart SDK's?
Your launch.json file is Ok, just check the file name. The main problem is that you use the debug button from the upper-right corner of the editor, but this button does not accept settings from launch.json.
You should use debug panel on the left side, as shown in the screenshot:
Make sure configuration's name (to the right of the green arrow) matches one from launch.json.

Open source file in Electron DevTools in VSCode

I am running an Electron app and developing it with VSCode and I have my debugging setup connected to VSCode, so that I can debug break points both in the main process and the renderer process. When I get error messages in my DevTools console I want to be able click on the source file on the right and have it open the target file in VSCode, and not in the "Sources" tab of the Devtools. This is what I am talking about:
I don't want it to open the file here, but rather in VSCode:
Is this possible? How?

Run command line when a document is saved in Visual Studio 2013?

I'm currently evaluating using VS2013 for a HTML5 project.
In this project I would like to be able to run a command line tool every time a file is saved (and have the file path passed as argument to the command line tool), and then have the output displayed in the console in VS. It's also important that this setup can be part of the project file, so that when a developer opens the project it's already setup correctly and ready to go without any additional configuring in VS.
In both Sublime Text and Webstorm projects all this is easy to achieve, but I haven't been able to find anything similar in Visual Studio. Any tips would be much appreciated!
You can set a DocumentSaved handler with Visual Commander and run a tool. See the "2. Run Cppcheck on the saved file and show results in the Output window" extension sample.