This chapter enables developers to write command-line tools using the Roslyn compiler and workspaces API to analyze and/or edit C# code. The article at (https://github.com/dotnet/roslyn/wiki/Roslyn%20Overview) provides a very good introduction to the Roslyn APIs at each of these layers.
We will provide you a gist from the article:
- Compiler API: The compiler layer contains the object models that correspond with information exposed at each phase of the compiler pipeline, both syntactic and semantic. The compiler layer also contains an immutable snapshot of a single invocation of a compiler, including assembly references, compiler options, and source code files. There are two distinct APIs that represent the C# language and the Visual Basic language. These two APIs are similar in shape but tailored for high fidelity to each individual language. This layer has no dependencies on Visual Studio components.
- Workspaces API: The Workspaces layer contains the Workspaces API, which is the...