- 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;
}
推薦閱讀
- Qt 5 and OpenCV 4 Computer Vision Projects
- 構建移動網站與APP:HTML 5移動開發入門與實戰(跨平臺移動開發叢書)
- 三維圖形化C++趣味編程
- VSTO開發入門教程
- Rust Cookbook
- HTML5入門經典
- Linux:Embedded Development
- Learning ArcGIS for Desktop
- RabbitMQ Essentials
- 深入淺出React和Redux
- OpenResty完全開發指南:構建百萬級別并發的Web應用
- 基于SpringBoot實現:Java分布式中間件開發入門與實戰
- OpenCV 3計算機視覺:Python語言實現(原書第2版)
- Learning D
- Java 9:Building Robust Modular Applications