I have just installed the resharper extension on my Visual Studio and when I type the following:
public string value {get; set;}
Resharper adds the braces around get;set; and highlights the last }. Then when I type }, it adds another } in the line below it?
Why is this happening?
I know this is a pretty old topic, but I just ran across this myself after reinstalling reshaper 10 for VS2015 - it's maddening...I cant believe this bug has been around this long.
To correct it:
Remove the checkbox next to "Auto Format on Closing Brace" - this will allow overtyping on the ending brace in properties without adding the additional brace.
Options Dialog for Resharper
This might not be ReSharper, but actually Visual Studio. Since 2013, Visual Studio supports automatic brace completion, but it doesn't play well with that of ReSharper (which is preferable, since it supports overtyping - typing another } will replace an existing }).
Best thing you can do is to turn off Visual Studio's automatic brace completion, by going to Tools - Options - Text Editor - C# and unchecking "Automatic brace completion":
EDIT: I just noticed you tagged this as visual-studio-2012, which doesn't support this out of the box. Do you have the Productivity Power Tools extension installed as well?
Related
This started happening for me in Visual Studio 2019 but does not happen in 2017. I cannot figure out how to stop it.
Something I do all the time is make use of Resharper's reformatting. Suppose I have little block of code like this:
Scan = scan;
Target = target;
IsDone = true;
ShouldAlign = false;
I want to align it up to look all nice and neat. So I select my block of code and I either use the menu or a keyboard shortcut to invoke Resharper's autoformat to line up the equals signs. Voila! Looks great, Here is the reformatted code, exactly as it appears, right after I've reformatted. Note the code is still selected:
But then all I have to do is I click anywhere else in the whitespace of that document, and Boom! Everything gets undone
It is as if VS2019 runs its own "Format Selection" command when I click away But I never did that. (but if I manually do, it has the same effect)
However if instead of just clicking away on the whitespace I, click the menu area of Visual Studio and then click the document whitespace, no problem. No reformat.
Just now I've just finished comparing Visual Studio 2017 and 2019 editing settings side-by-side next to each other. I've compared every single edit/formatting/spacing setting I can possibly find. Both Visual Studio's and Resharper's. They are identical except in those few cases where VS 2019 has some new setting that 2017 did not.
This still happens even when all of VS2019's "automatically format" settings are off
I'm asking the same question of the Resharper folks but I think it has to do with the interaction of the two.
Is anyone else seeing anything like this? It's driving me nuts.
After several hours of this, I have finally discovered that that problem was neither Visual Studio nor Resharper. It was actually a THIRD extension I use (also very common) for C++ files called Visual Assist".
VA has its own "format after paste" option. I am guessing that it must detect the reformat/click away as a "paste" operation and it reformats it according to Visual Studio's settings.
Once I disabled that in single, Visual Assist option VS2019 (as I apparently already had in 2017) everything worked well.
I've installed Resharper 7.1, and I'm getting some strange behaviour
When navigating through code using F12 (go to definition), VS 2012 was usually displaying the preview tab on the upper right hand side, to avoid lots of files being open and stacking up
However, I've noticed that now it behaves erratically
I've tried with resharper on and off, this is what happens
Resharper ON : when pressing F12 into a base class name (or any class definition), instead of previewing the file, VS just opens the file (same that happened in VS 2010).
Resharper OFF : when pressing F12 into a base class name (or any class definition), VS opens the preview tab, file doesn't stay open
So, I assume that Resharper is doing something with the shortcuts or some strange option that's messing the preview feature
More strange is that SOMETIMES it does work with resharper, but I couldn't find a distinctive pattern of when it's working and when it's not...
Any ideas?
It looks like this was a FEATURE! (can't believe it...)
http://sticklebackplastic.com/post/2013/02/01/New-ReSharper-plugin-bringing-the-preview-tab-back.aspx
Does anyone know how to fix this, besides pressing esc then typing the variable name again?
JetBrains ReSharper 6.1 C# Edition
Build 6.1.37.86 on 2011-12-21T04:15:24
Plugins: none
Visual Studio 10.0.30319.1.
You may want to try changing the IntelliSense option:
Whether you're using IntelliSense ReSharper or Visual Studio, try changing it, then changing it back. I've sometimes had similar issues and toggling the option can help.
Usually restart of Visual Studio tends to re-enable intellisense, I'd much rather a proper fix from JetBrains.
For me, R# intellisense stopped working after installing (and then uninstalling) certain R# extensions. Adding the extensions back fixed the problem.
Edit 1:
Also, try playing with the R# IntelliSense options and see what happens.
In particular switch "Options | Environment | IntelliSense | Completion Appearance | Display completion items in:" from "Visual Studio IntelliSense font" to "Text Editor font" and back.
In the end I tried many things (including upgrading and downgrading R#) over and over again until R# IntelliSense was back.
I had this issue, and I hadn't realized I had opened a project in Folder view mode. Resharper Intellisense won't show unless you switch to a solution view.
Make sure you select a solution instead of a Folder view:
I have Resharper installed and somehow CtrlW no longer "extends the selection". I tried assigning it to Global / Resharper.ExtendSelection in Tools -> Options -> Keyboard but it still only selects one word.
I have found the resolutions. Go to ReSharper -> Options -> Visual Studio Integration -> Keybord Shortcuts --> ReSharper or IntelliJ IDEA.Next time when you press CtrlW, Visual studio will ask you about shortcuts. You will choice ReSharper shortcuts and that is it.
A solution i found was to reconfigure keys at the Text Editor level (they are defined at Global level and for some (annoying) reason Resharper overrides this.
So: (Tools->Options->Environment->Keyboard), set Use new shortcut to Text Editor and redefine your shortcuts.
Tip: Look for your CtrlW favorites by writing view. at Show commands containing.
I needed View.ErrorList (CtrlW, CtrlE), View.Output (CtrlW, CtrlO) & View.SolutionExplorer (CtrlW, CtrlS)
HTH
p.s.
I even disabled Resharper and it still won't work...
A question and a suggestion:
Does Resharper | Edit | Extend Selection work?
Reapply VS integration via Resharper | Options | Visual Studio Integration | Apply Scheme
For me the reason was a silly one:
My C# file was removed from the project accidentally, so resharper no longer regarded it as C# code and so there were no syntactical elements to extend the selection to. In other files it worked ok.
In my case (Visual 2019)
go to Tools\Options\Environment\Keyboard
set Apply the following additional keyboard mapping scheme to Resharper (Visual Studio)
I had the silliest reason.
after the resharper installation I didn't apply my license or started the evaluation.
I've become accustomed to using ReSharper, so uninstalling it is not an option.
However 1 little thing that I would like to try fix is the immediate window, I used to get automatic intellisense prompts when for example typing myObject.
That seems to no longer be working (and only in immediate window while debugging) since I installed ReSharper. Any ideas on how to get it back?
Unfortunately, if you're using the ReSharper intellisense (instead of the Visual Studio one), it won't work. I remember reading somewhere that this is a known issue due to a limitation in the Visual Studio extensibility API. This also affects the watch dialog.
The only thing you could do is manually invoke intellisense each time using Ctrl-Space. Perhaps this issue will be solved in Visual Studio 2010.
The problem is ReSharper and there is no current any solution.
And the shortcut for intellisense-pop is Ctrl + Space, (not Ctrl + Alt + Space)