All Projects → conan-roslyn → Conan

conan-roslyn / Conan

Lightweight fork of the .NET Compiler Platform ("Roslyn") by adding a compiler plugin infrastructure

Projects that are alternatives of or similar to Conan

Sonar Dotnet
Code analyzer for C# and VB.NET projects https://redirect.sonarsource.com/plugins/vbnet.html
Stars: ✭ 466 (+385.42%)
Mutual labels:  roslyn
Rosetta
Toolset for migrating your codebase from C# to TypeScript
Stars: ✭ 23 (-76.04%)
Mutual labels:  roslyn
Forge
A Generic Low-Code Framework Built on a Config-Driven Tree Walker
Stars: ✭ 70 (-27.08%)
Mutual labels:  roslyn
Uno
Build Mobile, Desktop and WebAssembly apps with C# and XAML. Today. Open source and professionally supported.
Stars: ✭ 6,029 (+6180.21%)
Mutual labels:  roslyn
Mappinggenerator
🔄 "AutoMapper" like, Roslyn based, code fix provider that allows to generate mapping code in design time.
Stars: ✭ 831 (+765.63%)
Mutual labels:  roslyn
Omnisharp Roslyn
OmniSharp server (HTTP, STDIO) based on Roslyn workspaces
Stars: ✭ 1,062 (+1006.25%)
Mutual labels:  roslyn
Awesome Roslyn
Curated list of awesome Roslyn books, tutorials, open-source projects, analyzers, code fixes, refactorings, and source generators
Stars: ✭ 395 (+311.46%)
Mutual labels:  roslyn
Jab
C# Source Generator based dependency injection container implementation.
Stars: ✭ 87 (-9.37%)
Mutual labels:  roslyn
Polygen
PolyGen is a code generator that produces database schema, ORM layer, REST API and a (coming soon — stay tuned!) single-page web UI for your business model.
Stars: ✭ 19 (-80.21%)
Mutual labels:  roslyn
Enhanced Syntax Highlighting
[Marketplace] Lightweight "editor classifier extension" for Visual Studio based on the async Roslyn APIs to enhanced highlighting custom tags in C# code.
Stars: ✭ 69 (-28.12%)
Mutual labels:  roslyn
Security Code Scan
Vulnerability Patterns Detector for C# and VB.NET
Stars: ✭ 550 (+472.92%)
Mutual labels:  roslyn
Natasha
基于 Roslyn 的 C# 动态程序集构建库,该库允许开发者在运行时使用 C# 代码构建域 / 程序集 / 类 / 结构体 / 枚举 / 接口 / 方法等,使得程序在运行的时候可以增加新的模块及功能。Natasha 集成了域管理/插件管理,可以实现域隔离,域卸载,热拔插等功能。 该库遵循完整的编译流程,提供完整的错误提示, 可自动添加引用,完善的数据结构构建模板让开发者只专注于程序集脚本的编写,兼容 stanadard2.0 / netcoreapp3.0+, 跨平台,统一、简便的链式 API。 且我们会尽快修复您的问题及回复您的 issue.
Stars: ✭ 705 (+634.38%)
Mutual labels:  roslyn
Csharpextensions
A set of annotations and analyzers that add additional constraints to your codebase
Stars: ✭ 59 (-38.54%)
Mutual labels:  roslyn
Roslynclrheapallocationanalyzer
Roslyn based C# heap allocation diagnostic analyzer that can detect explicit and many implicit allocations like boxing, display classes a.k.a closures, implicit delegate creations, etc.
Stars: ✭ 492 (+412.5%)
Mutual labels:  roslyn
Git Rocket Filter
Rewrite git branches in a powerful way
Stars: ✭ 73 (-23.96%)
Mutual labels:  roslyn
Codeconverter
Convert code from C# to VB.NET and vice versa using Roslyn
Stars: ✭ 432 (+350%)
Mutual labels:  roslyn
Microsoft.codeanalysis.activepatterns
F# Active pattern library for Roslyn Compiler Platform (C#, VB)
Stars: ✭ 27 (-71.87%)
Mutual labels:  roslyn
Roslynpad
A cross-platform C# editor based on Roslyn and AvalonEdit
Stars: ✭ 1,310 (+1264.58%)
Mutual labels:  roslyn
Gistlyn
Run Roslyn Gists
Stars: ✭ 75 (-21.87%)
Mutual labels:  roslyn
Simplestubs
*SimpleStubs* is a simple mocking framework that supports Universal Windows Platform (UWP), .NET Core and .NET framework. SimpleStubs is currently developed and maintained by Microsoft BigPark Studios in Vancouver.
Stars: ✭ 66 (-31.25%)
Mutual labels:  roslyn

Conan Build status

Conan is a lightweight fork of the .NET Compiler Platform ("Roslyn") by adding a compiler plugin infrastructure. These plugins can be deployed and installed as regular Diagnostic Analyzers.

Notice

This repository is under construction, a documentation will follow in the coming weeks

Usage

How to develop a Conan compiler plugin?

  1. Create a netstandard1.3 library
  2. Add the latest Conan.CodeAnalysis package (alpha5+)
  3. Create a new class an inherit from CompilationRewriter. See HelloWorld plugin example
        [DiagnosticAnalyzer(LanguageNames.CSharp)]
        public class MyCompilationRewriter : CompilationRewriter
        {
            public override Compilation Rewrite(CompilationRewriterContext context)
            {
                var compilation = context.Compilation;
    
                // Transform compilation
                ...
    
                return compilation;
            }
        }
    
  4. If you want to create a NuGet package for this plugin, you can add a reference to the NuGet package AnalyzerPack and it will transform automatically your package into a Diagnostic Analyzer NuGet package (when doing a dotnet/msbuild Pack)

How to use this plugin in your project?

  1. Add the package Conan.Net.Compilers to your project: This will make the Conan compiler as the default CSharp/VB compiler and replace the default Roslyn compiler (This package works for both Full framework and Core framework unlike the Roslyn packages)
  2. Add your plugin you developed either by:
    • Adding directly a reference to it into your csproj. This is what is used by the HelloWorld package:
        <ItemGroup>
            <Analyzer Include="..\Conan.Plugin.HelloWorld\bin\$(Configuration)\netstandard1.3\Conan.Plugin.HelloWorld.dll" />
        </ItemGroup>
      
    • Adding a reference to the NuGet package of your plugin (that has been through AnalyzerPack)
  3. If you compile your project, the plugin will be automatically loaded and executed, check the logs!

NuGet Packages

Their are 2 fundamental root packages in Conan:

  • Conan.Net.Compilers: This is the Conan compiler that is replacing the default Roslyn compiler, working with both .NET full framework and .NET Core projects. This compiler will be responsible to load your Conan plugins (as Diagnostic Analyzers)
  • Conan.CodeAnalysis: This is the root package for developing a Conan compiler plugin that you should reference from your plugin compiler library
Roslyn Conan NuGet
Microsoft.Net.Compilers
Microsoft.NETCore.Compilers
Conan.Net.Compilers NuGet
Microsoft.CodeAnalysis Conan.CodeAnalysis NuGet
• Microsoft.CodeAnalysis.Common Conan.CodeAnalysis.Common NuGet
• Microsoft.CodeAnalysis.CSharp Conan.CodeAnalysis.CSharp NuGet
• Microsoft.CodeAnalysis.CSharp.Workspaces Conan.CodeAnalysis.CSharp.Workspaces NuGet
• Microsoft.CodeAnalysis.VisualBasic Conan.CodeAnalysis.VisualBasic NuGet
• Microsoft.CodeAnalysis.VisualBasic.Workspaces Conan.CodeAnalysis.VisualBasic.Workspaces NuGet
• Microsoft.CodeAnalysis.Workspaces.Common Conan.CodeAnalysis.Workspaces.Common NuGet

Credits

All the people involved behind the .NET Compiler Platform ("Roslyn"). Conan is a very little addition to the huge work already done there.

The logo is called Lion created by Jennifer Keana from the Noun Project

Licensing

Same license than Roslyn: Apache-2.0

Author

Alexandre MUTEL aka xoofx

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].