StyleCop icon indicating copy to clipboard operation
StyleCop copied to clipboard

Allow R# adjustment of SA0xxx inspections

Open cmeeren opened this issue 8 years ago • 10 comments

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.

cmeeren avatar Apr 06 '17 13:04 cmeeren

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.

citizenmatt avatar Apr 07 '17 19:04 citizenmatt

Thanks. Is C# 7 support on the roadmap? Any idea when it will happen?

cmeeren avatar Apr 07 '17 20:04 cmeeren

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.

mvonballmo avatar Apr 07 '17 21:04 mvonballmo

@cmeeren , please help review and close this ticket.

SanjayGuntur avatar Jun 24 '17 03:06 SanjayGuntur

@SanjayGuntur I'm sorry - what exactly am I supposed to review?

cmeeren avatar Jun 24 '17 21:06 cmeeren

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?

SanjayGuntur avatar Jun 25 '17 03:06 SanjayGuntur

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).

cmeeren avatar Jun 25 '17 08:06 cmeeren

Understood, i'll tag this ticket appropriately.

SanjayGuntur avatar Jun 25 '17 10:06 SanjayGuntur

Any news on this? :) I still run into "errors" every now and then when using some C# 7 syntax

asser-dk avatar Aug 02 '18 13:08 asser-dk

*C# 9 😁

JosXa avatar Jan 16 '21 07:01 JosXa