BT

Ready for InfoQ 3.0? Try the new design and let us know what you think!

The SharpDevelop Community Releases Refactoring Essentials 2

| by Pierre-Luc Maheu Follow 4 Followers on Nov 04, 2015. Estimated reading time: 1 minute |

The SharpDevelop Community recently released version 2 of Refactoring Essentials for Visual Studio. The release brings new analyzers, new refactorings and several improvements to the Visual Studio extension. 

Refactoring Essentials is a rewrite of NRefactory, porting the features from a custom compiler to the C#/VB compiler platform Roslyn. Several changes were also made outside the implementation. Refactoring Essentials moved to a repository of it’s own, splitting from NRefactory. A new dedicated website was also published as part of the rewrite effort.

The version 2 brings several three new refactorings:

  • Put inside 'using'
  • Iterate via 'foreach'
  • Merge nested 'if'

It also brings eight new analyzers:

  • Redundant explicit size in array creation
  • Redundant comma in array initializer
  • Redundant base constructor call
  • Empty argument list is redundant
  • Local variable is never used
  • Parameter is assigned but its value is never used
  • Redundant condition check before assignment
  • Convert 'if...return' to 'return'

The image below shows an example of an analyzer suggesting to use the nameof operator of C# 6:


The C# version contains 96 refactorings and 102 analyzers. On the VB side, there are 16 refactorings and 2 analyzers. The complete list can be found on the Refactoring Essentials website.

The public release of Roslyn earlier this year made the implementation of code aware librairies in Visual Studio more accessible, removing the need of a custom or third party compiler to analyze C#/VB source code. Putting aside the features, Refactoring Essentials also provides an example of a live code aware library using the APIs of Roslyn by being open source.

Refactoring Essentials is available online as a Visual Studio 2015 extension. It is also available as a nuget package for build integration.

Rate this Article

Adoption Stage
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Tell us what you think

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Sharpdevelop by Dzmitry Lahoda

Once I wanted to donate to Sharpdevelop, but they stated will not accept donation :(

They produce good tools for me.

I hope one day they will produce something like LINQPad and accept some donations. Now I use MonoDevelop as LINQPad, but it lacks some features.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Email me replies to any of my messages in this thread

1 Discuss
BT