Using the R# keyboard shortcut for formatting code presents the following window:
which forces me click the Run button every time.
Is there a way to bind a keyboard shortcut directly into the Reformat Code option, rather than just opening this dialog window?
Edit: To make things clear, I don't actually click the Run button with the cursor, I press Enter. (I still find it annoying, and wish for a direct shortcut.)
Oh sweet.. I just checked Tools -> Options -> Keyboard and found the command "ReSharper_SilentCleanupCode". It seems to execute ReSharper's code formatting function without popping up the dialog. Give it a try but try to not break your fingers... the default is ctrl-alt-shift-f :D That needs a rebind...
Although I can't answer the question directly I want to propose Ctrl-K-D as an alternative. This will invoke Visual Studio built-in formatting. It is less thorough but also less intrusive.
Related
The expected behavior when pressing enter on an IntelliSense suggestion in the Watch Window would be that the selected item is filled in and that I can continue typing.
Instead, the selection is filled in and then immediately executed so that I have to re-select the entry field each time.
This is obviously just a minor nuisance, but it would be great if someone knew how to change this behavior (or at least provide a shortcut that only enters the suggestion without immediately executing).
I agreed with Camilo and thanks for his help. To help improve this issue and help other community members handle and search similar issues, I have added an answer here:
Answer
Actually, how to invoke Intellisense on Watch Window is quite different from the Code Editor. And Enter key under watch window is for executing the detection of the input content. Every time you click the enter key on the watch window, it will monitor the values that have been entered.
Suggestion
So if you want to continue the pop-up suggestions for certain content on the Watch Window, you should use Tab key.
I am working with the new asp.net core 1.0 framework on Visual Studio Code.
My question is, how do I traverse through all the overloads a method might have?
When at that stage you can just press ( and it will prompt you for the overloads.
Take this example:
I press ( and I get:
If I happen to change focus, I can go back into the call at this.M1( and press Ctrl+Shift+Space (or ⌘+Shift+Space on macOS) to get the overload prompt again:
Pretty much the same as Visual Studio.
This is in VS Code 1.7.1, C# 1.4.1 extension.
I can't comment on the accepted answer but in case anyone has the problem Dawson B mentioned, where you can't navigate the little window of overloads with the vim extension enabled, I found a solution. It was difficult to figure out what that window is called as it's not easy to google, but it is apparently a ParameterHint.
Open the Keyboard Shortcuts with Ctrl+K Ctrl+S, search for "hint", click the pencil to the left of showNextParameterHint, change to Alt+N, and showPrevParameterHint to Alt+P, to not interfere with the Ctrl+N/P binding to Intellisense suggestion navigation. Of course if these conflict with some other extension/custom binding you have, pick whatever works best.
I don't understand why resharper Alt + Insert inserts not class, but it's template instead.
Any ideas, why?
I suspect that there is an exception being thrown while it is being inserted and it fails to finish expanding the template. Can you run VS with devenv.exe /ReSharper.Internal and try again, please? Keep an eye out for a small popup in the bottom right of the window with details about an exception.
If ReSharper doesn't work for one solution, try to clean Resharper caches:
https://resharper-support.jetbrains.com/hc/en-us/articles/206546989-ReSharper-stopped-working-for-a-single-specific-solution
I think the shortcut Alt + Ins is assigned to wrong command. Follow below steps and verify whether the keyboard shortcut is correct. Otherwise assign Alt+Ins to correct command.
-On the main menu, choose Tools | Options. Expand the Environment
node, then click Keyboard.
I did some research on this before asking the question and since I might be asking it incorrectly, I might not have done the right searches here first.
What I am trying to accomplish is when I start to debug or run an application in Visual Studio, is to have the IDE show me what methods are executing when I do something in the GUI/application.
For instance if I click a button in the GUI labelled "Search", I want to see the chain of events/methods that execute for this process. This I am not sure of. I hope I have asked the question correctly. Thank you for your time.
Have a try with IntelliTrace.
Make sure IntelliTrace is enabled and call information is selected;
Launch your GUI application, and perform what action you want;
In IntelliTrace window, click Break All. If IntelliTrace window is not displayed, click Debug -> Windows -> IntelliTrace Event;
Expand the event you are interested, for example, 'Clicked Search', and click Call View link;
You can see call stack you are interested.
There are two ways to approach this:
If you have no idea where the code you are looking for is, then simply start your program with a Profiler such as JetBrains dotTrace. Then, get ready to push the button, click "Start Profiling", click the button, and then as soon as the operation is finished, click "Get Snapshot". Now, use dotTrace's Call Tree to see which methods called which. I use this technique all the time for just this purpose!
In this view, you can use the arrows key to navigate the method-calls tree.
If you have a general idea of which class[/es] get invoked when you hit the button on the GUI, but don't know exactly which methods are called, you can use OzCode's "Add Breakpoint to Every Method" on a class, so that even if you don't know the exact method that's about to be called, whenever the class is accessed, you'll break into the debugger and be able to explore.
Due Diligence Disclaimer: I am a co-creator of OzCode.
You can use the Runtime Flow tool (commercial, developed by me) to see the chain of events/methods in a .NET application for GUI actions.
OK, this is a silly question, but when using Visual Studio, if I am writing XML doc comments in Visual Basic, I can use the tab key to switch between fields (e.g. Summary to Param to Returns). In C#, however, hitting the Tab key inserts a Tab, so I have to click on the individual fields to navigate to them (or use the arrow keys). This makes what should have been a simple process tedious and time-consuming.
Anybody know if there is a default keyboard shortcut I can use, or if there is a specific command I can map to an unused keyboard shortcut? I am using Visual Studio 2010, with ReSharper 6.1. Did some searching in the SO archives, but either nobody else has this problem, or I don't know the right keywords to ask (the latter is much more likely). Thanks in advance!
EDIT: I should clarify, a bit. The tabbing behavior in VB is native to Visual Studio 2010; the ReSharper install is fairly recent (after I switched to C#), and I wanted to mention it in case someone might know whether ReSharper had added their own navigation shortcuts (as they have tons) for this. Thanks again!
Resharper does have the possibility for structural navigation. Normally you can use the Tab or Shift+Tab Shortcut to the next or previous code element.
If your cursor is in a code element (i.e. not in the whitespace region before a code line) the Tab Key shouldn't insert a tab but navigate to the next section.
Configuration of the structural navigation can be done in Environment|Editor|Editor Behaviour.
If it's still not working as described I'd try to reset the settings (especially those for Resharper) and check wether Resharper is installed properly.
I might be misunderstanding the question, but maybe it sounds like you can just reset your user settings? http://msdn.microsoft.com/en-us/library/ms247075%28v=vs.100%29.aspx ? Or just run a devenv / resetuserdata . Do that, and when you start up visual studio, maybe choose the 'general' settings rather than the C# or vb.net specific ones?