6

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?

pius
  • 2,344
  • 1
  • 23
  • 25
  • 1
    I've read http://www.omnisharp.net/ or https://github.com/OmniSharp/omnisharp-vim. If there are any more detailed documentation I haven't found, please enlighten me. – pius Nov 14 '14 at 10:51
  • If you didn't find anything relevant there like command-line flags, inline flags to put in your code or options to put in a global or per-project config file then there's almost certainly no way to do what you want. But I doubt it, as even javascript linters have that kind of flag or configuration facilities. – romainl Nov 14 '14 at 11:00

1 Answers1

5

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$" 
],
pius
  • 2,344
  • 1
  • 23
  • 25
jasoni
  • 816
  • 5
  • 12