Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
steviegt6 authored Jan 31, 2023
1 parent 79a8520 commit cabd01a
Showing 1 changed file with 35 additions and 1 deletion.
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,37 @@
> **Warning** | This is not a practical project. If you find yourself ever needing this, consider rethinking everything.
# cle-elum

Experimental Roslyn activities and other fun stuff.
> compiler hacking!!!!!1!! but for c#
---

Experimental, questionable Roslyn activities.

## Things

### Roslyn Modding

Modify Roslyn in-memory with [MonoMod](https://github.com/MonoMod/MonoMod) (RuntimeDetour) and a somewhat convenient little bit of API boilerplate:

```cs
[DiagnosticAnalyzer(LanguageNames.CSharp)]
public sealed class MyAnalyzer : DiagnosticAnalyzer {
public override ImmutableArray<DiagnosticDescriptor> SupportedDiagnostics =>
ImmutableArray<DiagnosticDescriptor>.Empty;

public MyAnalyzer() {
// Your entrypoint lies within this class' constructor.
BootstrapAnalyzer.EnsureInitialized();
Patch();
}

public override void Initialize(AnalysisContext context) { }

private static void Patch() {
// use monomod here
}
}
```

General changes that make normally-invalid stuff valid will be reflected properly in Visual Studio, but not anything that doesn't use Roslyn (such as Rider).

0 comments on commit cabd01a

Please sign in to comment.