Alessandro is back with DelSole.CrossAnalyzers
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.
A collection of analyzers and refactorings for C# and Visual Basic on multiple platforms.
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.
DelSole.CrossAnalyzers.CSharp (NuGet package)
DelSole.CrossAnalyzers.VisualBasic (NuGet package)
A few examples in action:
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.
Detects assignments of List objects to ItemsSource and DataContext properties in platforms such as WPF, UWP, Xamarin where you should use ObservableCollection instead
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
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...