My Authors
Read all threads
Just got my first Roslyn Analyzer working! 😁

Still soooo many things to do, but I can see some awesomeness coming :D
After experimenting with #roslyn analyzers for four days now I collected some possible useful information which I will post in this thread now as it is the easiest (publicly accessible) storage.

0/n
Getting Started (Microsoft Docs):
docs.microsoft.com/en-us/visualst…
Introduction (Microsoft Docs):
docs.microsoft.com/en-us/dotnet/c…
Difference between Analyzers and Refactorings:
github.com/JosefPihrt/Ros…
Getting Started C# Syntax Analysis:
github.com/dotnet/roslyn/…
Introduction to Roslyn and its use in program development (by @CPP_Coder):
medium.com/@CPP_Coder/int…
Introduction with Publishing (by @meziantou):
meziantou.net/writing-a-rosl…
Awesome Example (Talk 👏) by @dcampbell (Building an Analyzer for ImmutableCollections):
channel9.msdn.com/events/Build/2…
[💯 useful] Working with types in a Roslyn analyzer (by @meziantou):
meziantou.net/working-with-t…
How to get Invoked method name in Roslyn?:
stackoverflow.com/a/29614689
Roslyn Get Method Declaration from InvocationExpression:
stackoverflow.com/a/45362532
Example that shows ways to improve performance and how to compare method invocations (ImmutableCollection):
github.com/dotnet/roslyn-…
[code] Check if type equals generic type:

((INamedTypeSymbol)...).ConstructedFrom.Equals(...)
[code] Construct TypeInfo:

compilation.GetTypeByMetadataName("<namespace>.<typename>[`<number of generics>]")
a kind of glossary:
github.com/dotnet/roslyn/…
How to use Roslyn to get compile time constant value:
stackoverflow.com/questions/3567…
[code] Using the Semantic Model with a SyntaxNode as the basis:

- semanticModel.GetSymbolInfo(expression);
- semanticModel.GetTypeInfo(expression);
- semanticModel.GetOperation(expression);
Microsoft.CodeAnalysis.CSharp.PatternMatching:
github.com/pvginkel/Micro…
Creating Code using the Syntax Factory (by @johnkoerner):
johnkoerner.com/csharp/creatin…
Generate Roslyn Code (by @KirillOsenkov):
roslynquoter.azurewebsites.net
Getting Started C# Syntax Transformation:
github.com/dotnet/roslyn/…
Missing some Tweet in this thread? You can try to force a refresh.

Enjoying this thread?

Keep Current with Bernhard Mayr

Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

Twitter may remove this content at anytime, convert it as a PDF, save and print for later use!

Try unrolling a thread yourself!

how to unroll video

1) Follow Thread Reader App on Twitter so you can easily mention us!

2) Go to a Twitter thread (series of Tweets by the same owner) and mention us with a keyword "unroll" @threadreaderapp unroll

You can practice here first or read more on our help page!

Follow Us on Twitter!

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just three indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3.00/month or $30.00/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!