Category Archives: Roslyn API

Improve Code Fix performance using correct CodeAction.Create overload

In my previous post I wrote about solution-wide Rename Code Fix using Roslyn, which is supposed to analyze method declarations and suggest a fix when method marked with async modifier does not have a name that ends with Async. The code I suggested works just fine, however there were some comments about improvements that can be made to make it work better. In this post I’m trying to address one of the suggestions, what results in seconds version of AsyncMethodNameAnalyzer and AsyncMethodNameFix.
Continue reading Improve Code Fix performance using correct CodeAction.Create overload

My first “Diagnostic with Code Fix” using Roslyn API

I think everyone already knows that during //Build conference Anders Hejlsberg announced that Roslyn API (renamed to .NET Compiler Platform) is now an open source project (he actually clicked Public button live, on stage). It’s really a great news. But even though a lot of people think that main purpose of that move is to allow everyone to make his own version of C#, I don’t think that’s true. I think the main purpose of Roslyn project is still the same – to provide modern and open compiler infrastructure which will make extension development much easier, because extension code now knows exactly the same stuff compiler does. Because of that I decided to give it a try and write simple Diagnostic with Code Fix.
Continue reading My first “Diagnostic with Code Fix” using Roslyn API