Route to Roslyn

A journey with C# that is leading to Roslyn

Generating default values

April 25, 2020
When generating code, you may need to instantiate a variable or a parameter with some placeholder value (On my end, I needed to assign values of base class’s constructor parameters). The easiest solution will be using the default literal. Or if you want to be more traditional and support older C# versions, using 0 for value types (except structs) and null for reference types will give the same result. But these approaches have some issues with method overloading.
Continue Reading →

Symbols and types for dummies

March 27, 2020
Roslyn uses a lot of technical terms from programming language and compiler design. Sometimes it can be hard to understand or guess what a property retrieves or a method executes for regular coders. There is not enough samples in the documentation, not enough discussion in stackoverflow, or not a tool to debug or display semantic model and symbols; so I decided to write about symbols in the simplest form, as code snippets.
Continue Reading →

Making Visual Studio extension command visibility optional

July 2, 2019
So you are developing a Visual Studio extension which has some commands. And you want to make these commands’ visibility optional, so that the user can hide or display these commands based on her preference. Sounds pretty simple, right. Well, unfortunately it is anything but simple. Because it requires implementing multiple features just for one task, and these features are mostly unrelated.
Continue Reading →

About

June 25, 2019
Hey, I’m Yellow, I develop tools and games. In this blog, I’ll mostly write about C# and Roslyn. I’ll try to write about topics that has no clear documentation or has not been discussed in stackoverflow or any other blog.
Continue Reading →