Understanding Workspaces
A workspace is a representation of a solution, as a collection of projects, where each project has a collection of documents. A document typically represents a source code file. A solution is an immutable model of projects and documents and is represented by the Microsoft.CodeAnalysis.Solution object; projects and documents are represented by the Microsoft.CodeAnalysis.Project and Microsoft.CodeAnalysis.Document objects, respectively. You can select the workspace to analyze and then get the semantic model and syntax trees via methods like GetSemanticModelAsync and GetSyntaxTreeAsync.
Now that you have gotten an overview of the main points of interest in the .NET Compiler Platform, it is time to start building analyzers ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access