如何配置Omnisharp Syntastic语法检查器以变得更加宽容?

6
我遵循了这个指南来设置我的vim用于c#。它运作得非常好,但是我有一个烦恼:Syntastic检查器对我来说有点太苛刻了。具体来说,它建议我更改这一行代码:
var parser = new Parser(configuration, findReservations: true);

出现了“Redundant argument name specification”消息。当然,我可以按照提示去做,但我喜欢我的冗余参数规范。否则,我的代码读者可能不记得该布尔值的作用。那么...我该如何告诉Syntastic(或Omnisharp)放松对这种警告的限制呢?


1
我已经阅读了http://www.omnisharp.net/或https://github.com/OmniSharp/omnisharp-vim。如果还有更详细的文档,烦请指教。 - pius
如果你在那里没有找到任何相关的内容,例如命令行标志、内联标志放置在你的代码中或者放置在全局或每个项目配置文件中的选项,那么几乎肯定没有办法做到你想要的。但我怀疑这一点,因为即使是JavaScript linters也有那种标志或配置设施。 - romainl
1个回答

5
在服务器的/bin/Debug文件夹中修改config.json文件。在我的机器上,服务器位于~/.vim/bundle/Omnisharp/server/OmniSharp
你会看到一些示例被忽略的代码问题在默认配置文件中。
要忽略这个特定的问题,请添加此规则:
"^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$" 
],

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接