I recently installed R# 6.1 (C# version, not Full) with StyleCop 4.7.34.0 (with the R# plugin). When adding a new class to a project, the file header information is automatically added. How do you disable this?
I've turned off the checkbox for "Insert text into documentation and file headers" within the R# options for StyleCop (Options > Tools > StyleCop > Headers section).... but still no luck.
I've also turned off StyleCop rules SA1633 to SA1640 that requires the header documentation.
I found this related post that suggests:
ReSharper -> Options -> Tools section -> Code Cleanup -> select StyleCop profile -> Documentation section -> untick 1600
but I don't have a "Code Cleanup" node in my tools section. Not sure if the fact that I'm using a "C#" version of R# has something to do with it.
The problem is actually because of this:
http://stylecop.codeplex.com/discussions/348351/
When you try to uncheck the StyleCop settings under Code Cleanup (Options > Code Editing > Code Cleanup > StyleCop > 1600 and 1633-1641) and click Save it does not actually save the changes! This seems to be a bug in ReSharper.
The only workaround i've found is to make a new profile (Add) and immediately uncheck 1600 then click Save. This will have to be set as the Profile to use on silent cleanup. Good luck
EDIT: here are the settings for my profile that is set as the 'silent cleanup' one. It does not add the headers. hope that helps
I had this problem and found that the issue was not ReSharpers global StyleCop settings (arserbin3s answer); but the project specific ones.
Right click on your existing project and select "StyleCop Settings".
First step
From there deselect "Documentation Rules" (or the specific rules you desire).
Second step
Finally, I had to close and open Visual Studio. This prevented Resharper refactors from writing the headers and documentation.
You may have different context menu options to me.
Either way, the key is that StyleCop can be project specific.
stylecop.codeplex.com/wikipage?title=Managing%20StyleCop%20Project%20Settings
Related
My understanding is that running StyleCop as a ReSharper extension uses the Analyzer technology built into VS 2015 and, in this way, it differs from downloading and installing StyleCop as a standalone program. When I previously installed StyleCop as a standalone program, I had access to a StyleCop .Settings file that let me use the StyleCop dialog box for selecting certain options. Among those options was a Company Information tab, into which you can place Company Name and a Copyright notice:
StyleCop Settings Documentation for the Company Information Tab
When ReSharper shows a StyleCop rule that needs attention and it has to do with adding a XML summary comment to the top of my class, ReSharper places the comment text for me. However, there is a space for Company Name and that value is always blank. This means that I must modify it manually, and that's tedious.
Question:
How do I tell ReSharper to populate the Company Name field with a certain value? Can I do that on a solution basis or does that Company Name field get defined globally?
Thank you.
If you're using StyleCop for ReSharper, it's actually using the same StyleCop parser that the command line uses, and not the VS2015 analyzers (unless you're actually using StyleCopAnalyzers). However, inserting comments and rewriting code is all ReSharper code. The plugin will still use your existing stylecop.settings files, and the company name comes from there. You can edit the file with the settings editor from the normal install of StyleCop.
With VS2013 Pro I am not able to use "Edit and Continue" when debugging an MFC program. I created a new MFC project to test.
OS is Windows 7 64-bit and I'm running Visual Studio 2013 12.0.30110.00 Update1.
Under Tools->Options->Debugging->Edit and Continue I have Enable Edit and Continue checked. I have unchecked it and checked it, but whenever I modify the code while debugging I get the following message:
The source file has changed. It no longer matches the version of the file used to build the application being debugged.
Basically I haven't changed any settings except for the tab sizes and I've set the keyboard mapping scheme to VC6.
What setting am I missing to enable edit and continue?
Edit and Continue is disabled for native code by default. To enable:
On the Tools menu, click Options.
In the Options dialog box, open the Debugging node, and select the Edit and Continue category.
In the Native-only options group, select Enable native Edit and Continue
Edit:
Steps to test native Edit and Continue is working:
Start VS 2013
Create a new MFC project:
FILE->New Project->MFC Application->OK.
Select Finish on the MFC Application Wizard.
Build and start debugging:
BUILD->Build Solution
DEBUG->Start Debugging
Break into the program:
DEBUG->Break all
Make a code change:
Open OutputWnd.cpp and find COutputWnd::OnSize (Line 80)
Insert this line at the start of the function: cx = cx / 2;
Continue execution:
DEBUG->Continue
Resize the application window to see the effect of the code change on the Output pane at the bottom. Its width should be half the required size.
Edit and continue is also a Setting for each project.
It must be set in the compiler options under C++ -> General -> Debug Information Format: "Program Database for Edit And Continue (/ZI)"
Also the linker settings must be changed. The linker has to use incremental linking. Linker -> General -> Enable Incremental Linking = Yes or (for VC 2012 users) C++ -> All Options -> Enable Function-Level Linking = Yes (/Gy)
For more information read the MSDN.
The last hint helped, but we had to
set "Image Has Safe exception handlers" = NO(/SAFESEH:NO)
in all projects of our solution!
I did all steps described above, but nothing helps (thanks all for it).
My solution was:
Project -> Properties -> Linker -> Advanced:
set
"Image Has Safe exception handlers" = NO(/SAFESEH:NO)
Apply, Ok, and Rebuild project.
Hope it helps.
For what it's worth I've been pulling my hair out on this one as well. I finally got edit and continue working by changing the following setting:
Project > Properties > Linker > All Options > "image has safe exception handlers".
It was set to No (/SAFESEH:NO). I went in and deleted it. I didn't set it to YES, or NO. I simply kept it blank. I would love to know what it means to be blank. But edit and continue is now working for me. Maybe it will help for you.
A project with a "Release Configuration" will disable Edit and Continue.
To change this
Open "Configuration Manager"
Change Configuration for the project from Release to Debug
Rebuild and debug project
Edit and Continue will also not work if your project's Platform Toolset is set to Visual Studio 2012 (v110), instead of the usual Visual Studio 2013 (v120).
This setting is in Project > Configuration Properties > General > Platform Toolset.
The solution of this problem is on the Microsoft Documentation...
If IntelliTrace is enabled and you collect both IntelliTrace events and call information, Edit and Continue is disabled.
On Visual studios' menu go on Tools>>options - Select "IntelliTrace" tab and let IntelliTrace events only checked.. Save, restart the visual studio and.......
Your Edit and Continue will work again!
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.
I have a C# license for ReSharper, and a little while ago Jetbarins gave me a license key for a 30 day trial of ReSharper full. This has expired and I have gone back to ReSharper C#, and as a result have completely lost VB intellisense.
How do I restore normal VB.Net intellisense from within Visual Studio? Is there a way to do this without resetting all Visual Studio settings (I have changed a number of settings, don't want to have to go through and change them all again).
I had this same problem after my ReSharper trial expired.
The fix is to go to Tools > Options > Text Editor > All Languages.
Then under Statement completion, ensure 'Auto list members' and 'Parameter information' are checked (for me they were partially selected)
Just an update for VS2013, you can go into Tools>Options and find Resharper as it's own menu item there, then click suspend.
It seems to undo all the changes it made at this point and restore my original settings.
Also consider reenabling errors in about the same place: Options > Text Editor > C# > Advanced
Under "Editor Help" section, recheck:
Underline errors in the editor
Show live semantic errors
Source: http://resharper-support.jetbrains.com/hc/en-us/articles/206104078-Visual-Studio-IntelliSense-is-broken-after-uninstalling-suspending-ReSharper
We're using ReSharper 6.0 with StyleCop for ReSharper.
Although we use the StyleCop rule that members must have documentation headers, we don't want ReSharper's code cleanup facility to generate documentation headers for us, because they're inevitably rubbish. Bad doc headers are worse than none at all because they're less likely to be updated than added in the first place.
We tried turning off the setting 'Insert text into documentation and file headers' in ReSharper => Options => Tools => StyleCop but it bloody resets itself when you restart visual studio.
Any ideas how we can stop Code Cleanup creating documentation headers for us?
ReSharper -> Options -> Tools section -> Code Cleanup -> select StyleCop profile -> Documentation section -> untick 1600.
Will prevent default documentation headers being created but StyleCop will still enforce that they should be there.
The second step, after blocking code generation is Removing the rubbish.
I used a regex Search/Replace through visual studio.
Regex is for header :
// ---.*\r\n\/\/.*\r\n\/\/.*\r\n\/\/.*\r\n\/\/.*\r\n\/\/.*\r\n.*\r\n\/\/.-{116}
Regex to remove Generated summaries
\s{4}\/\/\/\s<summary>(.*)\r\n.*\r\n.*</summary>
Caution : it will remove ALL summaries, even the good ones, so check the replacement scope before launching it. (git checkout might be your friend...)