Alessandro is back with DelSole.CrossAnalyzers

Description

Alessandro DelSole, of Code Snippet Studio fame, is back with a set of cool code analyzers and refactorings. There's no a ton, but that's the point. When you create your own analyzers and refactorings you don't need everything and the kitchen sink. You just need enough to get the job done. Targeted tools...

If you're a MVVM guy or gal, you'll immediately see Alessandro target. :)

Best of all, besides being open source, he's provided both C# and VB.Net versions and distributed them both via the Gallery and NuGet.

AlessandroDelSole/DelSole.CrossAnalyzers

A collection of analyzers and refactorings for C# and Visual Basic on multiple platforms.

Note

DelSole.CrossAnalyzers is available for both C# and Visual Basic (DelSole.CrossAnalyzers.CSharp and DelSole.CrossAnalyzers.VisualBasic), as both NuGet packages and extensions for Visual Studio 2015 (VSIX).

It is important mentioning that with NuGet packages you only get anlyzers and code fixes (where available).

If you want to use refactorings, you must install the Visual Studio extensions.

Downloads

DelSole.CrossAnalyzers.CSharp (NuGet package) Generic Episode Image

DelSole.CrossAnalyzers.VisualBasic (NuGet package) Generic Episode Image

DelSole.CrossAnalyzers.CSharp (Extension) Generic Episode Image

DelSole.CrossAnalyzers.VisualBasic (Extension) Generic Episode Image

Go to documentation

A few examples in action:

687474703a2f2f636f6d6d756e6974792e76697375616c2d62617369632e69742f696d616765732f636f6d6d756e6974795f76697375616c2d62617369635f69742f616c65

Welcome to the DelSole.CrossAnalyzers wiki!

DelSole.CrossAnalyzers is a collection of code analyzers and refactorings for both C# and Visual Basic, intended to work on multiple platforms and to simplify common tasks. Analyzers are available as you type, refactorings can be invoked right-clicking on a type definition.

Available analyzers

ObservableCollection analyzer

Detects assignments of List objects to ItemsSource and DataContext properties in platforms such as WPF, UWP, Xamarin where you should use ObservableCollection instead

DateTimeOffset Analyzer

Detects assignments of DateTime to objects of type DateTimeOffset

Async Suffix Analyzer

Detects and fixes missing Async suffix on async method names.

Async Void Analyzer (Visual Basic only)

Detects and fixes async Sub that are not event handlers changing to Async Task

Available refactorings

Implement INotifyPropertyChanged interface

Implements the INotifyPropertyChanged interface on a class that exposes any properties, providing explicit setters and OnPropertyChanged method invocation. In Visual Basic, the refactoring is available right-clicking a property declaration instead of a class. To be fixed soon.

Credits: this refactoring has been built using the same-named sample refactoring from the Roslyn Team, but with a different implementation of the interface. See original at: https://github.com/dotnet/roslyn/tree/master/src/Samples

Make ViewModelBase class

Creates a ViewModelBase class from a class declaration for MVVM.

Make RelayCommand class

Creates a RelayCommand class from a class declaration for MVVM.

Make ViewModel class (C# only)

Creates a ViewModel class from a business object, for MVVM.

Short, simple and targeted at MVVM. Just enough to get the job done...



The Discussion

Comments closed

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.