resharper disable for c# .cs files - resharper

is it possible to only enable resharper for javascript and css files? I don't want it inspecting my c# files as it's driving me nuts with it's styling and and at times somewhat controversial recommendations. I haven't got time to set each individual setting, I'm just looking for a "don't inspect c# files" check box, if there isn't one I think my resharper trial will be officially over.

If you really want to disable ReSharper for C#, try going to ReSharper | Options -> Code Inspection | Settings -> Edit Items to Skip and add a file mask to skip *.cs.
But better way would be to disable those ReSharper warnings that you don't like. To do this, click Alt-Enter on the suggestion that you don't like, go to Options submenu, select Configure inspection severity and then Do not show. This is for ReSharper 8.0, in 7.1 it should be pretty similar.

Related

Microsoft Visual Studio 2022 - Stop All and Any Formatting

I absolutely hate that Microsoft Visual Studio reformats my code. I'm constantly fighting with it. Over the years I've tried several versions and numerous settings but nothing stops the blighter. It insists on reformatting everything and as a general rule making a mess.
Automated re-indenting and alignment when applying brackets\braces or pasting in C#, Razor, HTML and JS files are my main pain points.
Seriously, it's a productivity issue and it drives me nuts 🥜. I know this question has been asked many, many times before, but surely, in this day and age there's a way to simply turn it ALL off?! Please tell me somewhere out there somebody knows how to do this.
Reference: Using Microsoft Visual Studio 2022 17.3.0. Community Edition. No plugins (Resharper etc.). All settings reset to defaults (using Tools > Import and Export Settings Wizard, Reset all Settings)
Side note: I know other IDEs exist but some projects just need MSVC and I'm not looking to change editors. Although I'd accept answers which recommend a plugin guaranteed to solve the problem.
This will not fully solve the issue but hopefully will already help so I'll post it as an answer.
Even without Resharper there are a lot of options under Text Editor settings and this allows you to control (to a certain extent) how the IDE formats your code, but sometimes it's option A or B and not "both" or "any". This means depending on what you type formatting will happen anyway, however as most people always format in a particular way, spending some time tweaking this is worth so once it is done it will be much less painful. Also the vast majority of settings is per specific language and not in the same structure, which does not make it easier. For C# - Braces for example, here's where to start:
Settings > C# > Code Style > Formatting > New Lines: all "Place open brace..." settings
Regarding the other main pain point (pasting) these should help:
HTML
Settings > Text Editor > HTML > Advanced: Set "Format on paste" to False.
JS
Settings > Text Editor > Javascript/Typescript > Formatting > General > Automatic Formatting: Uncheck "Format on paste"
C#
Settings > Text Editor > C# > Code Style > Formatting > General: Uncheck "Automatically format on... (all options to disable all)

Don't replace for-each by LINQ query

ReSharper wants to replace for-each by LINQ queries. I don't like that, and I don't want ReSharper even suggesting it.
How can I disable this?
I cannot find this in the ReSharper settings.
I don't want this // ReSharper disable LoopCanBeConvertedToQuery to be around each for-each.
I have a newer version, ReSharper 9, but here it is under ReSharper > Settings > Code Inspection > Inspection Severity. I think it might be there in your version as well.
There is a long list of all things it can show improvements on. Somewhere in there is Language Usage Opportunities which has two settings about loops and LINQ.
In ReSharper 9 there is also a possibility to search the settings above the treeview on the left or above the list in the Inspection Severity screen. Just type 'LINQ' there and it will show you the settings described above immediately.

ReSharper intellisense does not display documentation

Any idea why I'm not getting any documentation to go along with my ReSharper IntelliSense? If I go to the ReSharper options and enable the Visual Studio IntelliSense instead, I get the proper documentation when going through the members in the IntelliSense pop up. If I re-enable the ReSharper IntelliSense, I now get the ReSharper IntelliSense pop up sans documentation.
Go to ReSharper | Options -> Environment | IntelliSense | Completion Appearance. Check Show member signatures and Show summary.
For those who, like me, tried the solution provided above and it didn't work. I found this article and it did the trick for me.
Go to Tools - Options - Text Editor - C# (or all Languages, or whatever you need).
In the general section, the options Auto list Members and Parameter information must be enabled. (I suppose only Parameter Information would be fine to, but i enabled the other one anyway as its a nice feature).

Why do Visual Studio 2012 and ReSharper 7 forget to display Intellisense tooltips?

I noticed a strange behaviour in my VS2012 installation. I use VS2012 Pro and ReSharper 7. Intellisense is just not showing code suggestions anymore. I found a few related questions in my research but they always had a slightly different setup going and none could solve my problem:
Intellisense is working but, it's not showing the tooltip about selected member functions/Properties anymore.
If I take a look at the C# Text Editor Settings in
Tools -> Options -> Text Editor -> C# -> General
Most of the times the two necessary boxes Auto List Members and Parameter Information are selected. However, code suggestions in Intellisense don't work. Sometimes, when I look at the described settings, they are unselected.
Selecting them will make code suggestions work as in VS2010 but, only once. When I check the settings afterwards, they are most likely still selected, but code suggestions are not working anymore.
Some people suggested deleting the %AppData%\Roaming\Microsoft\VisualStudio\11.0 Folder, which did not work for me. I also tried to reset all changes, which also didn't help at all.
Tools -> Import and Export Settings -> Reset
What in the world could make Visual Studio to just forget its settings and trigger such an irrational behavior?
-edit-
I display the code suggestions by pressing CTRL+Alt+Space. However, I have to press that shortcut every time I want to see the suggestions. It has to be possible to automatically display them every time, when possible?
I was having a similar problem, but I kept overlooking one small ReSharper Intellisense setting. I would double check that you have Symbol completion on in
ReSharper | Options | Intellisense | Completion Characters
Check out the answer with screenshots.
Thanks for all the tips, I figured out what I had missing:
I had to enable "Completion Appearance" -> "Show Summary".
I also accepted Anthonys answer because he linked to a detailed post with screenshots that shows all steps necessary. (Although the thing I had missing is not mentioned there)
ReSharper uses it's own code suggestions that override Visual Studio ones, that could be the reason why the ones in the Visual Studio settings may be disabled. Please check ReSharper options at ReSharper -> Options -> Environment -> IntelliSense. Maybe they are turned off there. If your ReSharper options are turned on but you still have no intellisense, then please ReSharper's support at http://www.jetbrains.com/support/

Moving from coderush to resharper

I am about to make the switch to resharper from coderush after using it for 30 days and have some questions I would like to see if I can get some help on.
1: Can you change the resharper code colors? I tend to prefer dark themes so I would like to be able to migrate to a dark theme once the change is complete.
2: Do any other addin provide the member icon paint functionality of Coderush? It is the only feature that I do actually miss as it is handy for scanning. I don't mind paying for the functionality if it works.
EDIT: Found out how to change syntax colors.
There's no direct replacement of "paint member icons" in ReSharper.
I suggest that you use the File Structure window instead, with "Track caret in editor" and/or "Automatically scroll to source" options on to synchronize between focus in File Structure and the caret in the text editor.
As to other VS plug-ins, to my knowledge there aren't any prominent plug-ins that have that - neither VS10x CodeMap nor Productivity Power Tools provide anything similar.
1: Can you change the resharper code colors? I tend to prefer dark
themes so I would like to be able to migrate to a dark theme once the
change is complete.
As well as being able to change Resharper colours (In Tools->Options->Fonts and Colours, look for the "Resharper *" related options), R# supports Visual Studio light and dark themes:
http://www.jetbrains.com/resharper/webhelp/Managing_Color_Themes.html

Resources