You all know how much I like the features and capabilities that Roslyn has made available to us, primarily Analyzers and Refactorings.
Josef Pihrt has just released a Analyzer and Refactoring pack that you might find interesting. The best part? He's released the source too... :)
Roslyn-based library that offers more than 50 analyzers and more than 70 refactorings for C#.
C# Analyzers and RefactoringsVisual Studio extension that contains both analyzers and refactorings.
C# RefactoringsVisual Studio extension that contains only refactorings.
C# AnalyzersNuGet package that contains only analyzers.
Source code is available on GitHub.
id title default severity is enabled by default RCS1001 Add braces to a statement. Info x RCS1002 Remove braces from a statement. Hidden x RCS1003 Add braces to if-else chain. Info x RCS1004 Remove braces from if-else chain. Hidden x RCS1005 Simplify nested using statement. Hidden x RCS1006 Simplify else clause containing if statement. Hidden x RCS1007 Avoid embedded statement. Warning RCS1008 Declare explicit type (when the type is not obvious). Hidden x RCS1009 Declare explicit type in foreach (when the type is not obvious). Hidden x RCS1010 Declare implicit type (when the type is obvious). Hidden x RCS1012 Declare explicit type (even if the type is obvious). Hidden RCS1013 Use predefined type. Info RCS1014 Avoid implicit array creation. Info x RCS1015 Use nameof operator. Info x
title syntax scope Add braces to embedded statement do statement, else clause, fixed statement, for statement, foreach statement, if statement, lock statement, using statement, while statement Add braces to if-else chain if-else chain top if keyword Add braces to switch section switch section Add braces to switch sections switch statement switch keyword Add cast according to parameter type argument Add parameter name argument Add parameter name to each argument argument list Add parentheses expression selected expression Add using statement local declaration of type that implements IDisposable Convert "" to string.Empty empty string literal Convert auto-property to property with backing field auto-property Convert conditional expression to if-else conditional expression
Wondering how active Phil is in updating these?
And here’s a few more links you might find interesting:
- Refactoring Essentials now with a Roslyn Code Converter
- Roslyn... Succinctly...
- Building Roslyn-Based Analyzers and Diagnostics
- Preview v2.0 Refactoring Essentials now...
- Refactoring Essentials - Open Source, Cross Platform Refactoring and Analyzers
- Here's your 6 Pack for New Year's Eve... "NR6Pack for Visual Studio 2015"
- Analyze This, Analyze That, Writing .NET Code Analyzers and Fixers
- The future of .NET, today. The .NET Compiler Platform
Comments have been closed since this content was published more than 30 days ago, but if you'd like to send us feedback you can Contact Us.