By example:
1. I'm fixing a bug and need to break on exceptions. I set to break on all exceptions.
2. Then I decided do not break on some exceptions and disabled them.
3. I solved the bug and disabled all exceptions. Oops, all preferences are gone.
4. I found another bug and need to repeat really annoying step 2.
So, how to avoid repeating of the step 2?
This is partial but still quite useful answer on my question. Last week I was working on the program which generates a lot of exceptions on start up. I don't need to see them. But after the start I need to see all exceptions. So, I've wrote simple AutoHotkey script which just toggles main groups of exceptions when global hotkey pressed (Ctrl+Alt+e):
msvs:="Microsoft Visual Studio"
ex:="Exceptions"
^!e::
SetTitleMatchMode, 2
WinActivate, %msvs%
WinWaitActive, %msvs%
Send ^d
Sleep, 200
Send e
WinWaitActive, %ex%
Click 396 100
Click 396 120
Click 396 160
Click 396 180
Click 620 60
return
Related
I am testing out Visual Studio Code on macOS, and was wondering if there is a key combination for faster scrolling?
I would need this, for example, to go quickly from an early part of the code to a part towards the end of the file.
e.g. in Emacs when I hold up/down-arrow and hit Ctrl, the scroll speed increases noticeably; VS Code actually stops scrolling with the same command. Cmd+arrow will get me to the start / end of the file, but I could not find a combination that merely speeds things up and nothing in the keyboard shortcuts looked helpful.
Version is 1.21.1.
Update: Since v1.31 you can now press Alt to enable fast scrolling. It works by activating editor.fastScrollSensitivity.
There is
"editor.mouseWheelScrollSensitivity": 1, // or any number
You can scroll by pages too:
PageDown or PageUp
Go to File > Preferences > Settings. Search for: mouseWheelScrollSensitivity, change it for 0.01
in Emacs when I hold up/down-arrow [...]
The OP mentioned key strokes as opposed to mouse scrolling.
My solution was at an OS level, i.e. lessen the Key Repeat and Delay Until Repeat settings so that holding the up / down arrows will scroll much quicker.
Important note: This setting will update all key presses regardless of the app.
If on OSX, this setting can be found in System Preferences under Keyboard, or overwritten directly in the terminal. The following will take effect after a system reboot.
defaults write -g InitialKeyRepeat -int 10 # normal minimum is 15 (225 ms)
defaults write -g KeyRepeat -int 1 # normal minimum is 2 (30 ms)
It is not available, but is an open issue. You can follow the progress here:
https://github.com/Microsoft/vscode/issues/24344
In PyCharm debugging mode, is there way to let it stop right after it hits an error but not exit and highlight the offending line? The analogous feature I have in mind is "dbstop if error" of Matlab.
Yes, there is. Under Run, if you hit View Breakpoints (Ctrl + Shift + F8 on Windows) there's a checkbox where you can create an exception breakpoint for any exception.
The given answer was confusing to me. To do this you do not need to go to preferences, what you need to go is to break points menu bar (which is not in preferences for some reason). So:
Go to break point by pressing Command + shift + fn + F8 (Ctrl + Shift + F8 on Windows) or go to the breakpoints you have at the bottom (see picture 1). This opens the break point menu (see picture 2).
Then click enabled (for me suspend was already on so I only needed to click enabled). That's it.
Pic 1:
Pic 2:
Note: the reason this feature is useful is because after running an execution it halts with exactly the program state it caused it to err. For me I have stochastic code due to machine learning and reproducing the error exactly is annoying. I'd rather just see what cased the error, inspect the program state, stack etc and just fix it. There is even a little window at the bottom right to run code so I can test it right there while I am fixing it. I can even do control+shift+E to test pieces of code from my actual code (as I right new code).
I've made some searches but not found this question, sorry.
In a vb6 loop Ive a msgbox showed.
Any way to enter in debug mode (as using F8) ?
I need this in order to change the conditions of the msgbox.
And not, I can't restart the project because then I will lost the changes and the time the array took (several hours).
TIA.
Assuming you are running in Debugger when the MsgBox shows, press Ctrl + Break to interrupt the MsgBox and drop into single-line stepping.
you can use breakpoints-you mark the point in code by clicking on the bar near the code and then you run the code at the moment the instruction pointer gets to this point you will see the code and the values at this point.
hope this helped.
I was getting tired of hitting the F10 every step to debug the programs. Are there any program can automate the visual studio to run each debugging step in a consistent frequency? say, 3 seconds for each step?
Regards,
Sam
You can easily do that with a simple script in Autohotkey.
Download it from here: http://www.autohotkey.com/
Install Autohotkey.
Run it.
Find the green "H" icon in the task bar (bottom right).
Right click the icon and select Edit script.
And copy paste this script below.
^!y::
InputBox, input1, How many F10 strokes you want?, , , 250, 100
InputBox, input2, How many seconds between each F10 stroke?, , , 250, 100
if ErrorLevel <> 0
{
MsgBox, CANCEL was pressed.
}
else
{
loop, %input1%
{
Sleep, (input2 * 1000)
Send {F10}
}
MsgBox, "Your F10 script has Ended"
}
return
Then reload (again by right clicking the green "H" icon in task bar).
Press Control+Alt+y to try out the above script.
Sitting there repeatedly hitting F10 can be annoying, but you probably just need to make more use of the inbuilt debugging features.
set a breakpoint at a targetted location and hit F5 to run the program, it will stop when it hits the breakpoint
use F11 to step in to a function
use Shift-F11 to step out of a function
use the breakpoints window (Debug->Windows->Breakpoints) to get a complete list of all the bp's and you can easily enable/disable any of them (or set any of their other options)
use the Exceptions window (Debug->Exceptions) to select exceptions that you want to break on when they are first thrown
familiarize yourself with the options available to breakpoints (right-click on the bp itself to get these)
hit count: specify how many times code should go past the breakpoint before it stops
condition: super useful (i use it all the time), you can use almost any expression in there, including checking the value of inscope variables
when hit: you can run a macro when the breakpoint is hit
filter: to restrict which running thread can break on that breakpoint
The problem is exactly as asked in the question title.
When I'm typing in the text editor and referencing a public method that has a long signature (lots of parameters, usually 10 or more) the intellisense just stops working. It will sometimes flicker; other times it will not show at all.
Only seen this happen with C#, but I don't use anything else. It might happen in VB too. Don't know.
Anyone else seeing this?
I've Googled for an hour but can't seem to iron it out. I've restarted VS, rebooted the machine, enabled/disabled intellisense in Tools -> Options. NOTHING works.
You can hit CTRL Shift Spacebar to bring it back up.
Even better, Ctrl Shift Alt + C copies it to the clipboard.
Then Ctrl Shift Alt + P pastes it. Handy for templates.
I've discovered one cause for the problem.
If the method is at the top of the screen, it pops downwards.
If the method is at the bottom of the screen is pops upwards.
However in the middle of the screen if it's too big to go either way it gets confused - flickers or just won't open.
Unfortunately, no matter what I do I can't seem to get it to display more than 37 parameters...
Found a partial solution - change the font size
Was supposedly scheduled to be fixed in SP1...
http://social.msdn.microsoft.com/Forums/en/vseditor/thread/e2f06f24-0b68-48f3-a8b3-c31948f6e168