How can I configure the omnisharp syntastic syntax checker to be more lenient?

瘦欲@ 提交于 2019-12-06 02:15:29

问题


I've followed this guide for setting up my vim for c#. I works beautifully, but I've got an annoyance: The syntastic checker is a bit too harsh on me. Specifically it advises me to change this line:

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

with the message "Redundant argument name specification". Of course I COULD just do as it says, but I happen to like my redundant argument specification. The reader of my code might not remember what that boolean is for otherwise. So... how can I tell syntastic (or omnisharp) to relax about this kind of warning?


回答1:


Modify the config.json file in the /bin/Debug folder of the server. On my machine the server is located in ~/.vim/bundle/Omnisharp/server/OmniSharp.

You'll see some example ignored code issues in the default config file.

To ignore this particular issue, add this rule:

"^Redundant argument name specification$"

If this is the only rule, besides the default rules, the IgnoredCodeIssues section of the config.js file will look like this:

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


来源:https://stackoverflow.com/questions/26920887/how-can-i-configure-the-omnisharp-syntastic-syntax-checker-to-be-more-lenient

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!