StyleCop
StyleCop copied to clipboard
Allow R# adjustment of SA0xxx inspections
What with all the SA0102 errors currently (#88, #92, #94, #104, #106) due to lacking support for new C#7 stuff, it's a little annoying that this inspection can't be adjusted in ReSharper. In fact, I can't find any settings for any SA0xxx inspections.
Please allow us to ignore SA0102 (and any other SA0xxx inspections), just like with all other inspections. ReSharper is good enough at finding syntax errors on its own without false positives from StyleCop.
The problem is that if the StyleCop C# parser encounters new (or wrong) syntax, it will raise a syntax error and stop processing the rest of the file, meaning no StyleCop warnings at all. If we don't show syntax errors, then there will instead be issues raised here as to why ReSharper isn't showing any StyleCop warnings. It is better to show the reason why the StyleCop engine stopped than show nothing at all.
Basically, StyleCop just doesn't support C#7 - either disable it, or stick with C# 6.
Thanks. Is C# 7 support on the roadmap? Any idea when it will happen?
I remember reading one of @citizenmatt's posts a while back, called End of Year Round up of ReSharper 10 Extensions, in which he wrote:
If you’re using Visual Studio 2015 and C# 6, we recommend you use the StyleCopAnalyzers project, which has full support for C# 6, including new rules.
I remember trying out the StyleCopAnalyzers, but being much happier with this extension instead. Has the recommendation changed? From the project page for StyleCopAnalyzers, it looks to be still in active development. I think that's the project that's based on Roslyn, so it will support the latest language features.
The StyleCop project itself still looks active (and they've released a few versions, with a 5.0.0 beta 3 months ago. It's unclear what's in the beta, though.
I can't tell 100% what needs to be updated in order to get C# 7 support: StyleCop itself or this extension...or both.
@cmeeren , please help review and close this ticket.
@SanjayGuntur I'm sorry - what exactly am I supposed to review?
With c#7 syntax already supported, and the fact that SA0102 cannot be turned off with configuration, there is nothing more to do for this ticket? If so, this can be closed?
I can't see that C# 7 support has been added. I installed the latest version of the plugin from the R# Extension Manager, and I still get SA0102 on C#7 features such as pattern matching on a type ("switching on types", #106).
Understood, i'll tag this ticket appropriately.
Any news on this? :) I still run into "errors" every now and then when using some C# 7 syntax
*C# 9 😁