© Jason Bock 2016

Jason Bock, .NET Development Using the Compiler API, 10.1007/978-1-4842-2111-2_2

2. Writing Diagnostics

Jason Bock

(1)Shakopee, Minnesota, USA

Chapter 1 provided a foundational tour of the Compiler API. In this chapter, you’ll use that knowledge to build diagnostics. You’ll learn how to quickly find issues in code and provide code fixes to a developer when appropriate. You’ll also learn how to write unit tests for diagnostics and code fixes as well as debug your diagnostic code.

The Need to Diagnose Compilation

One of the first rules that I learned as a software developer is to “fail fast.” The quicker you can find an issue in your code, the less damage it can do (especially if you find it on your machine, then no one can blame ...

Get .NET Development Using the Compiler API now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.