- Roslyn Cookbook
- Manish Vasani
- 123字
- 2021-07-15 17:07:33
Creating a method body analyzer to analyze whole method and report issues
A stateful method body or code block analyzer registers action callbacks that require whole method body analysis to report issues about the method declaration or executable code. These analyzers generally need to initialize some mutable state at the start of the analysis, which is updated while analyzing the method body, and the final state is used to report diagnostics.
In this section, we will create a code block analyzer that flags unused method parameters. For example, it will not flag param1 and param2 as unused, but will flag param3 and param4.
void M(int param1, ref int param2, int param3, params int[] param4)
{
int local1 = param1;
param2 = 0;
}
推薦閱讀
- FuelPHP Application Development Blueprints
- 數字媒體應用教程
- Java Web基礎與實例教程(第2版·微課版)
- Responsive Web Design with HTML5 and CSS3
- PhpStorm Cookbook
- Mastering Python Networking
- Cocos2d-x學習筆記:完全掌握Lua API與游戲項目開發 (未來書庫)
- PhoneGap:Beginner's Guide(Third Edition)
- FPGA Verilog開發實戰指南:基于Intel Cyclone IV(進階篇)
- C語言程序設計
- Unity 2018 Shaders and Effects Cookbook
- Visual C#.NET Web應用程序設計
- QPanda量子計算編程
- TypeScript 2.x By Example
- Flink核心技術:源碼剖析與特性開發