MonoDevelop has an inconsistent code formatting policy

I’ve found that Unity’s version of MonoDevelop is inconsistent when it comes to inserting spaces between method names and their opening parentheses.

My desired format looks something like this:

Debug.Log("Note the lack of space between 'Log' and the opening parenthesis");

When using MonoDevelop’s code completion functionality to type a method, this works as expected. For example, when I type “Deb”, then hit the “Tab” key to select the “Debug” class, then “.” and “Lo” and again hit the “Tab” key to select the “Log” method, typing the opening parenthesis does not insert a space automatically. However, when explicitly typing out the full method name (i.e., “Debug.Log”) then typing the opening parenthesis, MonoDevelop inserts a space, making my resulting method call look like this:

Debug.Log ("Note the space between 'Log' and the opening parenthesis.");

This behavior has been driving me nuts ever since I started using MonoDevelop. It appears as though there’s a thread on Xamarin’s developer center about this, with a Xamarin team member calling it Unity’s fault. I don’t know where Unity stores MonoDevelop policies on the filesystem, nor whether or not this change would actually correct the issue.

A couple of points:

  • I’m using OS X Mavericks (10.9.2)
  • MonoDevelop-Unity is version 4.0.1

Any help is much appreciated. You can’t imagine how annoying this behavior is in an IDE (or maybe you can, but it seems the internet at large doesn’t really seem to care that much).

I am using 4.0.1 too (monodevelop 4.0.1, not unity), I get the space in every case. But if I type everything out, the space gets inserted with the closing );, maybe because thats the point where the editor checks what you wrote, if you use code completion, it will get tested earlier

I should also note that I’ve created a custom C# source code policy (and have manually applied it to my projects just in case) to explicitly turn off all white space “before opening parenthesis,” so in theory MonoDevelop should not be inserting any, anywhere. Yet there they are…