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 ...