Using Roslyn Syntax Visualizer to view Roslyn syntax tokens and nodes for a source file
The Syntax Visualizer
is a Visual Studio extension that facilitates the inspection and exploration of Roslyn syntax trees and can be used as a debugging aid when you develop your own applications atop the .NET Compiler Platform (Roslyn) APIs.
In this section, we will show you how to install and use the Roslyn Syntax Visualizer
to view the syntax tree, nodes, and properties of C# and Visual Basic source code in Visual Studio. You can also view the semantics associated with the syntax nodes, such as symbol information, type information, and compile time constant value of expressions.
Getting Started
You need to install the .NET Compiler Platform SDK
to install the Roslyn Syntax Visualizer
. For guidance on installing the SDK, refer to the recipe, Creating, debugging, and executing an analyzer project in Visual Studio, in Chapter 1, Writing Diagnostic Analyzers.
How to do it...
- Open Visual Studio and start the...