You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've been using C# Essentials since 2015. Since it has no official NuGet package, I've been reluctantly checking the DLL into source control to ensure it's available in every developer's environment. Recently, I got tired of doing that and decided to see what it would take to replace C# Essentials. In the Q&A section on C# Essentials - Visual Studio Marketplace, @DustinCampbell said on Nov 21, 2017:
There's not a need to support this extension for VS 2017 because most of its features are already included in VS itself. With the latest updates to VS 2017, you'll find that there are several code fixes and refactorings for transitioning your code to C# 7.
In Visual Studio 2022 and .NET 8, I found four of the five C# Essentials features built-in:
UseExpressionBodiedMember (CSE0003) - VS provides the "Use expression body for method" refactoring
ExpandExpressionBodiedMemberRefactoring - VS provides the "Use block body for method" refactoring
ConvertToInterpolatedString - VS provides the "Convert to interpolated string" refactoring
So, the only thing missing was UseGetterOnlyAutoProperty (CSE0002). I reimplemented it in my Menees.Analyzers library in release 3.1.0. I had to rewrite it to be compliant with modern Roslyn coding practices (e.g., to avoid GetSemanticModel per rule RS1030). I took the opportunity to make it ignore properties with attributes since they're typically used with reflection and/or serialization. I also updated it to handle some new C# syntax, e.g., null-coalescing assignment, local functions, and record types. And I made the code fixer handle some whitespace formatting cases better.
I hope this helps folks looking for equivalent functionality.
The text was updated successfully, but these errors were encountered:
I've been using C# Essentials since 2015. Since it has no official NuGet package, I've been reluctantly checking the DLL into source control to ensure it's available in every developer's environment. Recently, I got tired of doing that and decided to see what it would take to replace C# Essentials. In the Q&A section on C# Essentials - Visual Studio Marketplace, @DustinCampbell said on Nov 21, 2017:
In Visual Studio 2022 and .NET 8, I found four of the five C# Essentials features built-in:
So, the only thing missing was UseGetterOnlyAutoProperty (CSE0002). I reimplemented it in my Menees.Analyzers library in release 3.1.0. I had to rewrite it to be compliant with modern Roslyn coding practices (e.g., to avoid GetSemanticModel per rule RS1030). I took the opportunity to make it ignore properties with attributes since they're typically used with reflection and/or serialization. I also updated it to handle some new C# syntax, e.g., null-coalescing assignment, local functions, and record types. And I made the code fixer handle some whitespace formatting cases better.
I hope this helps folks looking for equivalent functionality.
The text was updated successfully, but these errors were encountered: