如何配置omnisharp syntastic语法检查器更宽松?

时间:2014-11-14 00:16:41

标签: c# vim syntastic omnisharp

我跟着this guide设置了我的v#c#。我工作得很漂亮,但我有一个烦恼:合成检查对我来说有点过于苛刻。具体来说,它建议我改变这一行:

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

带有“Redundant argument name specification”消息。当然我可以像它说的那样做,但我碰巧喜欢我的冗余参数规范。我的代码的读者可能不记得该布尔值是什么。所以...我怎么能告诉syntastic(或omnisharp)放松这种警告呢?

1 个答案:

答案 0 :(得分:5)

修改服务器config.json文件夹中的/bin/Debug文件。在我的机器上,服务器位于~/.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$" 
],
相关问题