What is the shortcut to skip all break-points in VS? - visual-studio

When I am at a breakpoint and if I want to ignore all the rest of breakpoints and move on, what shortcut should I use?

You can select "Disable All Breakpoints" from the Debug menu.
This and then continue with F5.
You could set this up as a keyboard shortcut under Tools/Options/Keyboard.

Well, you can:
delete all breakpoints using Ctrl+Shift+F9
disable all breakpoints from the ->Debug menu.
Disabling breakpoints does not have a shortcut defined, but you define your own in ->Tools->Options menu under Environment->Keyboard. Also Shift+F5 stops debugging altogether.

Ctrl+Shift+F9 will delete them all.
To disable all breakpoints - either you do it from the menu - or you go to option -> environment -> keyboard, and create a shortcut there.

Enabled / Disabled just one break point at a time with Ctrl + F9.
Though the cursor has to be on the given line of code.

By default there is no option available to Disable/Enable all breakpoints, so you need to add it. Steps to add Disable/Enable breakpoints are as :-
1) Under Tools tab select Customize.
2) Then under Commands tab, you would find 3 options(drop-downs) - Menu bar, Toolbar and Context menu.
3) So under Menu bar drop-down, scroll down and select option Debug.
4) And now under Controls section, select the command you need to add i.e here you would select command Enable All Breakpoints/Disable All Breakpoints and click Add Command.
5) Close this pop-up and boom, now you would find this option under Debug section of the main console.
No need to thank, just an upvote would work..!! :P :P

Shortcut to delete all break-points: CTRL+SHIFT+F9.

Related

What key shortcuts are to comment and uncomment code?

There were Ctrl+E+C (comment) and Ctrl+E+U (uncomment) in older versions, or Ctrl+K+C and Ctrl+K+U.
But in VS 2012, I can't see key shortcuts:
How to enable those shortcuts?
Keyboard accelerators are configurable. You can find out which keyboard accelerators are bound to a command in Tools -> Options on the Environment -> Keyboard page.
These commands are named Edit.CommentSelection and Edit.UncommentSelection.
(With my settings, these are bound to Ctrl+K, Ctrl+C and Ctrl+K, Ctrl+U. I would guess that these are the defaults, at least in the C++ defaults, but I don't know for sure. The best way to find out is to check your settings.)
You can also add the toolbar in Visual Studio to have the buttons available.
View > Toolbars > Text Editor
Use the keys CtrlK,C to comment out the line and CtrlK,U to uncomment the line.
From your screenshot it appears you have ReSharper installed.
Depending on the key binding options you chose when you installed it, some of your standard shortcuts may now be redirected to ReSharper commands. It's worth checking, for example Ctrl+E, C is used by R# for the code cleanup dialog.
This is how I did it,
Menu Tools → Options on the Environment → Keyboard window
One can alter the default shortcuts following the below steps
Select Edit.CommentSelection in the listbox
Click on "Remove" button
Select "Text Editor" option in the dropdown under "Use new shortcut in:"
Press your own shortcut in the textbox under "Press shortcut keys:"
Example: Pressing Ctrl+E and then C will give you Ctrl+E, C
Click on "Assign" button
Repeat the same for Edit.UnCommentSelection (Ctrl+E, U)
I went to menu: Tools → Options.
Environment → Keyboard.
Show command containing and searched: comment
I changed Edit.CommentSelection and assigned Ctrl+/ for commenting.
And I left Ctrl+K then U for the Edit.UncommentSelection.
These could be tweaked to the user's preference as to what key they would prefer for commenting/uncommenting.
"commentLine" is the name of function you are looking for. This function coment and uncoment with the same keybinding
Shift + alt + a
the command palette is great for finding shortcut keys.

How to force visual studion to ignore all other breakpoints except one

As title, How to force visual studio to ignore all other breakpoints except one
Under the Debug Menu click Disable All Breakpoints, then right click the Break Point in question and click Enable Break Point.
With breakpoints window (Debug | Windows | Breakpoints) having focus select all (control-a), control-click the break point you want to keep (to unselect) and untick one of the selected breakpoints. All the selected breakpoints will be disabled.
Try exporting all your breakpoints then choose Delete All Breakpoints from the Debug menu.
you can then re-add your breakpoint and import your old ones when you're ready.
In addition to Astander's answer, you can bring up the debug window (Ctrl D+B), and it has an option there to Enable or disable all breakpoints matching the current Search, with the Search box just along from it. Very nifty.

How can I disable ReSharper in Visual Studio and enable it again?

I installed ReSharper, and it works in Visual Studio, but how can I disable it?
Whenever I search in the ReSharper menu, I can't find a disable option.
You can disable ReSharper 5 and newer versions by using the Suspend Now button in menu Tools → Options → ReSharper.
If you want to do it without clicking too much, open the Command Window (Ctrl + W, A) and type:
ReSharper_Suspend or ReSharper_Resume depending on what you want.
Or you can even set a keyboard shortcut for this purpose. In Visual Studio, go to Tools -> Options -> Environment -> Keyboard.
There you can assign a keyboard shortcut to ReSharper_Suspend and ReSharper_Resume.
The Command Window can also be opened with Ctrl + Alt + A, just in case you're in the editor.
Bind ReSharper_ToggleSuspended to a shortcut key.
Steps:
Tools>Options
Click Keyboard on the left hand side
Type "suspend" in the "Show commands containing:" input box
Pick the "ReSharper_ToggleSuspended"
Press shortcut keys: and
Press the "Assign" button.
Binding ReSharper_ToggleSuspended to a shortcut key (in my case: Ctrl-Shift-Q) works very well. With ReSharper not supporting the async CTP yet (as of mid-2011), when dipping into the code the uses the async keyword, this shortcut is invaluable.
I always forget how to do this and this is the top result on Google. IMO, none of the answers here are satisfactory.
So the next time I search this and to help others, here's how to do it and what the button looks like to toggle it:
Make sure Resharper is currently enabled or the commands may fail.
Open package manager console via the Quick Launch bar near the caption buttons to launch a PowerShell instance.
Enter the code below into the Package Manager Console Powershell instance:
If you want to add it to the standard toolbar:
$cmdBar = $dte.CommandBars.Item("Standard")
$cmd = $dte.Commands.Item("ReSharper_ToggleSuspended")
$ctrl = $cmd.AddControl($cmdBar, $cmdBar.Controls.Count+1)
$ctrl.Caption = "R#"
If you want to add it to a new custom toolbar:
$toolbarType = [EnvDTE.vsCommandBarType]::vsCommandBarTypeToolbar
$cmdBar = $dte.Commands.AddCommandBar("Resharper", $toolbarType)
$cmd = $dte.Commands.Item("ReSharper_ToggleSuspended")
$ctrl = $cmd.AddControl($cmdBar, $cmdBar.Controls.Count+1)
$ctrl.Caption = "R#"
If you mess up and need to start over, remove it with:
$ctrl.Delete($cmdBar)
$dte.Commands.RemoveCommandBar($cmdBar)
In addition to adding the button, you may wish to add the keyboard shortcut
ctrl+shift+Num -, ctrl+shift+Num - that is: ctrl+shift+-+-
EDIT:
Looks like StingyJack found the original post I found long ago. It never shows up when I do a google search for this
https://stackoverflow.com/a/41792417/16391
If resharper is completely missing from the options menu, it could be because the extension itself has been disabled.
In Visual Studio 2017 ReSharper 2018.X.X can be enabled and disabled by going to Help > Manage Visual Studio Performance. Then select JetBrains ReSharper ... under Extensions.
In Visual Studio 2019, you would go under Extensions->Manage Extensions->Installed
You can add a menu item to toggle ReSharper if you don't want to use the command window or a shortcut key. Sadly the ReSharper_ToggleSuspended command can't be directly added to a menu (there's an open issue on that), but it's easy enough to work around:
Create a macro like this:
Sub ToggleResharper()
DTE.ExecuteCommand("ReSharper_ToggleSuspended")
End Sub
Then add a menu item to run that macro:
Tools | Customize...
Choose the Commands tab
Choose the menu you want to put the item on
Click Add Command...
In the list on the left, choose "Macros"
In the resulting list on the right, choose the macro
Click OK
Highlight your new command in the list and click Modify Selection... to set the menu item text etc.
You need to goto Tools-->Options--->Select Resharper--->Click on suspend now,to disable it
Now Resharper supports Suspend & Resume argument at devenv.exe
(ReSharper 2019.2.3)
Run VS & Suspend R#:
devenv.exe /ReSharper.Suspend
Run VS & Resume R#:
devenv.exe /ReSharper.Resume
Here's an example usage:
In case the solution did not help to just suspend resharper (STRG+R, STRG+R did still not work for example) I decided to disable the plugin and restart visual studio.
VisualStudio > Extras > Extensions > Resharper > Disable
https://learn.microsoft.com/en-us/visualstudio/extensibility/how-to-diagnose-extension-performance
In ReSharper 8:
Tools -> Options -> ReSharper -> Suspend Now
For ReSharper 2017.2.2, go to ReSharper | Options | Product and features.
Tools -> Options -> ReSharper (Tick "Show All setting" if ReSharper option not available ). Then you can do Suspend or Resume. Hope it helps (I tested only in VS2005)
Very simple steps:
Go to Extensions → Manage Extensions
Click on Installed section at the top left and search for "resharper"
You will see disable button over the extension, click to it then restart Visual Studio and that's it!

Visual Studio debug menu invisible

I feel a little stupid asking this, but the "Debug"-menu in my Visual Studio installation has disappeared. It supposed to be between the "Build" and "Tools" menu, but it is simply not there. Restarting VS doesn't help. Also tried looking for a way to customize the menus, but no success.
Any ideas where it went, and how I can get it back?
Right click on your menu -> Customize -> Select Menu Bar -> Click Reset button
alt text http://img63.imageshack.us/img63/3576/debugmenu.png
And make sure you're in debug mode :)
If this doesn't help try Tools menu -> Import and Export Settings -> Reset all settings
[VS2015] - During reseting be sure to choose 'General' preset. If you choose for example web dev code only it still would be invisible.
Inside the build menu drop down you will see the "Start Debug" submenu, you can start debugging by clicking "go" inside it. Or else you can press "F5" to start the debugging to see the Debug toolbar please follow the procedure given by Nokola.

Xcode + remove all breakpoints

Is there any way to remove all the breakpoints in Xcode?
Well there's a 3 step way:
Press CMD(⌘)+7 to show all breakpoints.
In Xcode4 press CMD(⌘)+6, in Xcode3 press CMD(⌘)+ALT+B.
Select all breakpoints with CMD(⌘)+A and delete them, like deleting text, with backspace.
There's no step 3 :)
Its very easy to do in new Xcode. Just click on breakpoints Tab then select all then delete.
Xcode 10 Screenshot:
Old Xcode Screenshot:
tap. See attach image for clear reference.
In Xcode, you can also do by right clicking the project name on the breakpoints tab and then you can see the options for deleting all breakpoints including disabling and sharing breakpoints.
In Xcode 4, in the debugger console, type "breakpoint delete" or "br del" for short:
(lldb) br del
About to delete all breakpoints, do you want to do that?: [Y/n] y
All breakpoints removed. (1 breakpoints)
(lldb)
You can't rely on the GUI breakpoint list, since nothing you enter from the command line will show up there.
Other ways:
Select Breakpoints group in Groups and Files tree, click in Detail view, Command-A, Delete
Disclose Breakpoints smartgroup in Groups and Files tree, shift- or command-select breakpoints in outline, press Delete
Run > Console, when app is paused, type "delete breakpoints" and press Return
Xcode 10
The most easiest way is to do ⌘ + y to disable enable breakpoints .
There is another way
go to Xcode project navigations pane
Click on show Breakpoint navigator
Right click on the project file and select disable all break points
In Xcode 9 it's CMD(⌘) + 8 to access all breakpoints, you can also just click here:
Then you can select and delete them.
Additionally, you can customize your Toolbar and put the "Breakpoints" button there. Click this on/off will active/deactivate all breakpoints. While this doesn't remove them, it may be useful if you just don't want them to be hit for a run.
As an addition to mxg 's answer above:
in Xcode 5 it's been changed to CMD(⌘) + 7
For Xcode 5:
In ToolBar, select Navigate -> select Reveal in Project Navigator -> In Navigator area, select Show the Breakpoint Navigator.
Here, You can edit, hide/unhide, share, move the breakpoint for each and every class.
Note: Because of Xcode newbie's, am explained the steps from toolbar to show the Breakpoint Navigator.
For XCode 12:
Press CMD ⌘ + 8
Select All (CMD ⌘ + A)
Right Click and Select "Delete Breakpoints"
For XCode 12.4
Click on Debug in Toolbar
Choose Breakpoints
Then Click on Delete All Breakpoints
That's it!!
CMD(⌘) + a
CMD(⌘) + /
CMD(⌘) + /
In XCode 7 you can just drag a bp into the project view window and an X will appear, release mouse and it will be deleted.

Resources