Giter VIP home page Giter VIP logo

awesome-roslyn's Introduction

Awesome Roslyn

Awesome

Curated list of Roslyn books, tutorials, open source projects, analyzers, code fixes, refactorings, and source generators.

Roslyn, officially named .NET Compiler Platform, is a set of open-source compilers and code analysis APIs for C# and Visual Basic .NET languages.

Contents

Books

Awesome books to give you a good start with Roslyn.

  • Roslyn Succinctly - Free e-book by Alessandro Del Sole and the perfect book to start with. Explains Roslyn APIs and afterward focuses on writing analyzers and refactorings.
  • .NET Development Using the Compiler API - Book by Jason Bock. Besides analyzers and refactorings, it also explains the scripting API and provides an interesting reflection on the future of the Compiler API.
  • Roslyn Cookbook - Book by Manish Vasani, a member of the Roslyn analyzers team. After covering analyzers, refactorings, and scripting in detail, the book goes in-depth explaining how to develop new C# language features and contribute to the Roslyn source code.

Tutorials

Awesome online tutorials to help you write your first analyzers, code fixes, and source generators.

Open Source Projects

Awesome open source projects built on top of Roslyn.

  • Bridge - C# to JavaScript transpiler. Write modern mobile and web apps in C# and run them anywhere in JavaScript.
  • Code Converter - C# to VB.NET and VB.NET to C# transpiler.
  • CodeAnalysis.CSharp.PatternMatching - Intuitive pattern matching for Roslyn syntax trees. Simplifies C# syntax and semantic analysis.
  • CodeGeneration.Roslyn - Roslyn-based Code Generation during a build with design-time support.
  • dotnet-script - Runs C# scripts from the .NET CLI, defines NuGet packages inline and edit/debugs them in VS Code.
  • FlubuCore - Cross platform build automation tool for building projects and executing deployment scripts using C# code.
  • MirrorSharp - Online C#, VB.NET, and F# code editor. Features code completion, method signature help, quick fixes, and diagnostics.
  • OmniSharp - Enables a cross platform .NET development in the editor of your choice. A family of open source projects, each with one goal: To enable a great .NET experience in your editor of choice.
  • roslyn-linq-rewrite - Compiles C# code by first rewriting the syntax trees of LINQ expressions using plain procedural code. This increases performance by minimizes heap allocations and dynamic dispatch.
  • RoslynPad - Cross-platform C# editor. Features code completion, method signature help, quick fixes, and diagnostics.
  • RoslynQuoter - Online tool that for a given C# program generates syntax tree API calls that construct syntax tree of that program.
  • scriptcs - Turns C# into a powerful scripting tool. Features C# REPL, installation of NuGet packages, and execution of scripts with a single line of code.
  • Scripty - Tool to use Roslyn-powered C# scripts for code generation. You can think of it as a scripted alternative to T4 templates.
  • Sharpen - Visual Studio extension that intelligently introduces new C# language features into your existing code base.
  • SharpLab - .NET code playground. Displays intermediate steps and results of code compilation. Shows the code as compiler sees it. Allows selecting different branches and versions of Roslyn. Runs C#, VB.NET, and F# code in the browser.
  • Testura.Code - Wrapper around the Roslyn API used for generation, saving, and compiling C# code. Provides methods and helpers to generate classes, methods, statements, and expressions.
  • Uno SourceGenerator - C# source code generator based on a project being built, using all of its syntactic and semantic model information.

Open Source Analyzers, Code Fixes, and Refactorings

Awesome open source analyzers, code fixes, and refactorings.

  • .NET Analyzers - GitHub organization for the development of Roslyn analyzers. Various repositories within the organization cover analyzers for ASP.NET Core, WPF, IDisposable, usages of System.Reflection, etc.
  • .NET Compiler Platform ("Roslyn") Analyzers - Diagnostic analyzers developed by the Roslyn team. Initially developed to help flesh out the design and implementation of the static analysis APIs. The analyzers cover code quality, .NET Core, desktop .NET Framework, comments in code, and more.
  • Code Cracker - Analyzer library for C# and VB.NET. Offers diagnostics in many categories like performance, coding styles, as well as some basic refactorings.
  • CSharpGuidelinesAnalyzer - Reports diagnostics for C# coding guidelines (https://csharpcodingguidelines.com/).
  • ErrorProne.NET - Set of analyzers and code fixes focusing on the correctness and performance of C# programs. Inspired with Google's Error Prone.
  • Mapping Generator - Code fix that generates arbitrary complex object-object mappings. It recognizes out of the box a large number of scenarios where mappings are used. A design-time alternative to AutoMapper.
  • Nullable.Extended - Roslyn tools and analyzers to improve the experience when coding with nullable reference types.
  • Refactoring Essentials for Visual Studio - Refactorings, analyzers and code fixes for C# and VB.NET.
  • Roslyn Clr Heap Allocation Analyzer - C# heap allocation analyzer that can detect explicit and many implicit allocations like boxing, closures, implicit delegate creations, etc.
  • Roslynator - Collection of 190+ analyzers and 190+ refactorings for C#. Covers coding style, code readability and simplification, removing redundancies, fixing compiler errors, and many more.
  • SonarC# - Static code analyzer for C# language used as an extension for the SonarQube platform.
  • StyleCop Analyzers for the .NET Compiler Platform - Port of StyleCop rules to Roslyn.
  • VSDiagnostics - Collection of code-quality analyzers. Covers usages of async methods, flags enums, best practices in exception handling as well as many other code-quality checks.

Libraries and Frameworks for Testing Analyzers, Code Fixes, and Refactorings

Awesome libraries and frameworks for testing analyzers, code fixes, and refactorings.

  • Microsoft.CodeAnalysis.Testing - Library for testing analyzers and code fixes with NUnit, xUnit and MSTest frameworks. A part of Roslyn SDK.
  • RoslynTestKit - Lightweight framework for writing unit tests for analyzers, code fixes, refactorings, and completion providers. It's unit testing framework agnostic.

Source Generators

Awesome (but mostly experimental at the moment, because .NET 5.0 and C# 9.0 are still in preview) source generators and open source projects that internally use source generators.

  • DpDtInject - Proof-of-concept of a dependency injection container that transfers huge piece of resolving logic to the compilation stage. Offers additional compile-time safety and fast runtime resolution.
  • Generator.Equals - Automatically implements equality and hashing for classes and records. Supports different comparison strategies. Offers similar functionality like IL weaving-based Equals.Fody.
  • JsonSrcGen - Reflection-free JSON serializer. Allows extremely fast JSON processing by generating reflection-free serializers at the compile time.
  • Source Generator Playground - Online application that lets you experiment with source generators. Perfect for learning and testing your ideas. Write your own source generator or learn from built-in examples and see the generated output.
  • StrongInject - Compile-time dependency injection container. Compile-time checked, reflection-free and runtime code generation free, thus fast and app-trimming-friendly.
  • StructPacker - Low-level, lightweight and performance-focused serializer for C# struct types. Auto-generates C# serialization code to achieve peak runtime performance and efficiency.
  • Svg to C# Source Generators - SVG to C# compiler. Compiles SVG drawing markup to C# using SkiaSharp as rendering engine.
  • WrapperValueObject - Creates boilerplate free wrappers around types. Especially useful for creating strongly typed wrappers around primitive types.

Blog Posts and Articles

Awesome blog posts and online articles covering various topics like performance, Roslyn history, internals and similar.

Talks

Awesome public talks about Roslyn.

  • The Power of Roslyn - Great talk by Kasey Uhlenhuth at NDC Oslo 2018 covering Roslyn essentials and APIs and tools for building code analyzers and fixes.

Contribute

Contributions are welcome :-) The goal is to build a categorized community-driven collection of awesome Roslyn resources. Before contributing, please make sure to read the contribution guidelines.

License

CC0

To the extent possible under law, Igor Rončević has waived all copyright and related or neighboring rights to this work.

awesome-roslyn's People

Contributors

anakic avatar cezarypiatek avatar diegofrata avatar fredimachado avatar hermanussen avatar ironcev avatar mzorec avatar pyrocumulus avatar tom-englert avatar yairhalberstadt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

awesome-roslyn's Issues

Add Metalama to the list - modern Aspects and Metaprogramming framework based on Roslyn APIs

Hi there !
Would you please add Metalama to the list?
It is a modern rewrite of PostSharp based on Roslyn APIs, and it offers very nice features. I totally felt in love with this tool, so I thought it could be on this list as well :) Many people would find it super useful :)

Here is the official website: https://www.postsharp.net/metalama
Here is the release blog post with quick overview of all features: https://blog.postsharp.net/post/metalama-2023.0.html

Add Communities to the list

Hi there!
Would you please add a new item to the list called Communities?
This is awesome place to see everything related to Roslyn, but not very much for live discussions and help and stuff like this.
But sadly, I can't find any community around Roslyn, so I've decided to create one, on Reddit.
I would be so happy if you join me there and add the link here :)
I will try to monitor everything around Roslyn and be active on that subreddit and post there often :)

https://www.reddit.com/r/RoslynAPI/

.NET Analyzers

There is an organization .NET Analyzers. There are some useful analyzers in this organization. I've opened this issue because I am not sure if the organization should be added or individual repositories in the organization?

StyleCopAnalyzers repository from this organization is already added on awesome-roslyn.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.