Resharper inserts wrong template - c#

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.

Related

Visual Studio 2019 Watch Window: IntelliSense Completion

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.

Broken "rename" feature

Lets say I have a variable like this :
Now when I rename the variable using the shortcut or menus and press enter, it becomes like this:
The "Show potential fixes" is not due to "Local constant 'renamed' never being used). It asks me to rename the variable again. Why?
I need to click on the "Show potential fixes and choose 'rename variable to renamed'" again. It's very annoying. Is there anyway to fix this?
I just want to use the resharper shortcut and be done with it.
The problem is that in this case for some reason Visual Studio is late to update its code model following the totally legitimate rename operation made by ReSharper.
However, if you ignore Visual Studio's prompt for the second bogus rename and proceed with editing code, Visual Studio will finally understand that a rename has actually occurred and stop asking you to perform it again.
All in all, this is indeed an annoyance but there's an easy workaround: just proceed with editing your code.
We at JetBrains are looking into the problem to see if we can fix it nicely but it's not clear so far if we are able to.

How do I jump between XML doc comments in C#?

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?

Reformatting code with R# in a single keyboard shortcut

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.

What's the default intellisense shortcut in vs2008?

I'd like to open the intelligence window without typing a character and then backspacing it. I can't seem to remember the shortcut for this. What is it?
Ctrl + Space for normal Intellisense, and Ctrl + Shift + Space for parameter Intellisense (e.g. to see what overloads are available in a method call which you've actually already filled in). I find the latter very handy :)
Ctrl + Space?
Also, go to Tools -> Options -> Environment -> Keyboard or Default Keyboard Shortcuts in Visual Studio, you can then search for commands and see what is assigned to that (and remap).
Ctrl + Space
If you have installed MSG Plus, then the problem is messenger lock keys, try to change them in msg plus and Intellisense will work again. Good Luck!

Categories