【问题标题】:Can Resharper (2016.1 C#) suggest exceptions to catch with a try catch block?Resharper (2016.1 C#) 能否建议使用 try catch 块捕获异常?
【发布时间】:2017-01-24 04:15:30
【问题描述】:

Resharper 或现有的 resharper 插件能否建议使用 try catch 块捕获异常?

例如,File.ReadAllText 会引发以下异常,是否有任何现有插件允许 resharper/intellisense 在我键入 catch 块时显示这些异常?

编辑:添加了一个链接,以便您可以投票支持 resharper 建议 https://resharper-support.jetbrains.com/hc/en-us/community/posts/115000073730-Suggest-exceptions-to-catch-when-typing-try-catch-block

【问题讨论】:

标签: c# visual-studio exception resharper


【解决方案1】:

Exceptional for ReSharper 做了类似的事情。它建议捕获异常,而不是在 IntelliSense 中,而是在静态分析代码时。

这当然取决于所有被调用方法的 XML 文档来包含可能引发的异常。

【讨论】:

  • 谢谢。它还可以做很多其他事情。
猜你喜欢
  • 2011-10-06
  • 1970-01-01
  • 2015-06-26
  • 2013-12-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2021-05-13
相关资源
最近更新 更多