【问题标题】:How can I configure the omnisharp syntastic syntax checker to be more lenient?如何将omnisharp syntastic 语法检查器配置为更宽松?
【发布时间】:2014-11-14 00:16:40
【问题描述】:

我已经关注this guide 为 c# 设置我的 vim。我工作得很好,但我有一个烦恼:合成检查器对我来说有点太苛刻了。具体来说,它建议我改变这一行:

var parser = new Parser(configuration, findReservations: true);

带有消息“冗余参数名称规范”。当然我可以照它说的做,但我碰巧喜欢我多余的参数说明。我的代码的读者可能不记得该布尔值的用途。那么...我怎样才能告诉 syntastic(或omnisharp)对这种警告放松?

【问题讨论】:

  • 我读过omnisharp.netgithub.com/OmniSharp/omnisharp-vim。如果我没有找到更详细的文档,请赐教。
  • 如果你没有找到任何相关的东西,比如命令行标志、嵌入代码的内联标志或放入全局或每个项目配置文件的选项,那么几乎可以肯定没有办法做你想做的事。但我对此表示怀疑,因为即使是 javascript linter 也有这种标志或配置工具。

标签: c# vim syntastic omnisharp


【解决方案1】:

修改服务器/bin/Debug文件夹下的config.json文件。在我的机器上,服务器位于~/.vim/bundle/Omnisharp/server/OmniSharp

您将在default config file 中看到一些示例被忽略的代码问题。

要忽略此特定问题,请添加以下规则:

"^Redundant argument name specification$"

如果这是唯一规则,除了默认规则之外,config.js 文件的 IgnoredCodeIssues 部分将如下所示:

"IgnoredCodeIssues": [
  "^Keyword 'private' is redundant. This is the default modifier.$",
  ".* should not separate words with an underscore.*",
  "^Redundant argument name specification$" 
],

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-11-09
    • 2013-11-30
    • 1970-01-01
    • 2011-11-06
    • 1970-01-01
    • 2023-03-30
    • 2016-08-17
    • 1970-01-01
    相关资源
    最近更新 更多