Sharpen is a Visual Studio extension that intelligently introduces new C# language features into your existing codebase. It makes your code shorter, simpler, more expressive, more performant, and more readable, in one word - sharper.
Sharpen identifies places in your code that will benefit from introducing new C# language features. It helps you to learn new C# features quicker and critically refactor your existing code to modern C#.
You can install Sharpen directly from Visual Studio or download it from the Visual Studio Marketplace.
Learn new C# features faster by applying them to your existing codebase.
Forget the simplified, artificial code samples often used to introduce new C# features. Sharpen points you to places in real-life production code - your production code! - where you can learn and apply modern C#.
Learn to ❤ C# but not blindly. Take love with a pinch of salt ;-)
Sharpen brings a critical view of C# features. It recommends applying them only if their usage will result in a "sharper" code. Sharpen is not shy of saying No! to a language feature.
Consistency matters. And your preferences, as well.
Once configured on your project, Sharpen ensures that usage of C# language features remains consistent over the whole codebase.
Safely refactor your code by a single mouse click.
Sharpen can refactor your code on an arbitrary scale: single place in code, single file, or a whole project, or solution. At the same time, it gives you full control over the scope and nature of the refactorings.
Are you still having BackgroundWorkers in your code?
It's time to replace them with async-await! Sharpen is equipped with an intelligent heuristics that recognizes potential improvements of your code on a broader scope.
Are you tired of searching for new C# features in random blog posts?
Sharpen comes with extensive built-in documentation on C# language features. It's a one-stop-shop for everything you ever wanted to know about the design and evolution of C#.
Note that in the current version of Sharpen the following features mentioned in the above chapters are still not available:
- Extensive documentation.
- Recommendations.
- Refactoring.
- Configuration.
Sharpen is a volunteer effort. Covering the whole C# evolution is a humongous task that cannot be carried out by a single person. So pitch in and join the development! :-) Before contributing, please make sure to read the contribution guidelines.
All notable changes to the Sharpen extension are documented in the changelog. Below is the excerpt from the changelog that lists only the summary of major changes.
- Bug fixes in the Sharpen Results view.
- Null-coalescing assignments suggestions (C# 8.0).
- "Learn more..." and "What is/was new in C# X.Y?" links to MSDN documentation in the Sharpen Results view.
- Async streams, nullable reference types, switch expressions, and using declarations suggestions (C# 8.0).
- Var keyword suggestions (C# 3.0).
- Support for Visual Studio 2019.
- Analysis of selected files, folders, and projects via "Analyze with Sharpen" option on context menus.
- Better display of Async and Await findings in the Sharpen Results view.
- Suggestion for awaiting task instead of calling Task.Result.
- Async/Await suggestions (C# 5.0).
- Suggestions for using nameof expressions in argument exceptions and dependency properties (C# 6.0).
- Suggestions for discarding of out variables (C# 7.0).
- Suggestions for usages of out variables in object creations (C# 7.0).
- Suggestions for usages of out variables (C# 7.0).
- Grouping of the analysis results by C# language feature.
- Suggestions for usages of default expressions (C# 7.1).
- Icon, preview image and release notes.
- Display of the analysis results in a tree view.
- Analysis of the whole solution.
- Suggestions for usages of expression-bodied members (C# 6.0 & C# 7.0).
Sharpen is licensed under the MIT license.