Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add breakpoint in Visual Studio Code

I must be doing something stupidly wrong as I just cannot seem to add breakpoints in Visual Studio Code.

The following pops up when I right click on my code. (left clicking beside the line numbers didn't work either)

enter image description here

I've read the documentation here https://code.visualstudio.com/docs/editor/debugging#_breakpoints

It states:

Breakpoints can be toggled by clicking on the editor margin.

I have no idea what it is or where I find it. To say the least the documentation for beginners is lacking.

like image 588
basickarl Avatar asked Aug 12 '16 17:08

basickarl


People also ask

Can't add breakpoint in VS code?

Go to VS->Settings->Debug and change "debug. allowBreakpointsEverywhere" to true. This was exactly the solution for me, I was unable to set breakpoints when editing JS within an HTML file.

How do I import breakpoints in Visual Studio?

If you delete all the breakpoints from your code at any time, you can easily import them by just clicking on the “ Import “ breakpoints button. This will restore all of your saved breakpoints. Note: Breakpoint Import depends on the line number where you have set your breakpoint earlier.

How do I add a breakpoint to all methods in visual studio?

Press F3 and then press F9 to add a breakpoint.


2 Answers

Go to VS->Settings->Debug and change "debug.allowBreakpointsEverywhere" to true.

like image 54
Roger Avatar answered Nov 09 '22 23:11

Roger


I also ran into this issue. Make sure you don't have

"editor.glyphMargin": false, 

in your user or workspace settings.

like image 40
interestinglythere Avatar answered Nov 09 '22 22:11

interestinglythere