向 Resharper 添加自定义检查

Add custom inspections to Resharper

我想向 Resharper 添加新的自定义检查。请考虑底部的屏幕截图。这意味着我需要能够遍历抽象语法树(或 Jetbrains 术语中的 PSI)。

我该如何实施?有例子吗?

此外,如何将我的规则配置导出到 XML 并导入到我的第二个笔记本上?

感谢您的关注!

resharper-inspections

您可以编写一个插件来执行此操作。您可以在 developer's guide.

中找到更多信息

至于一些样本,这里是 Cyclomatic Complexity checking, and then there are a lot of inspections in the Unity support