Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
14
Question by Drakestar · May 06, 2012 at 06:53 AM · monodevelopformatting

MonoDevelop - disable automatic whitespace between function name and round brackets?

Is there a setting to have MonoDevelop not insert an automatic whitespace between a function call and the round brackets? It automatically formats to this:

 private void Foo () {}
 Foo ();

But I want this:

 private void Foo() {}
 Foo();
Comment
Add comment · Show 7
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Lo0NuhtiK · May 06, 2012 at 06:54 AM 0
Share

$$anonymous$$ine doesn't do that, and I don't remember ever changing a setting in it.

avatar image Drakestar · May 06, 2012 at 07:15 AM 0
Share

It happens when typing through a Intellisense suggestion. For example, typing

Debug.Log(

results in

Debug.Log (

avatar image syclamoth · May 06, 2012 at 08:21 AM 0
Share

Now why would you want your code to look uglier? It does it for a reason, you know.

avatar image Drakestar · May 06, 2012 at 03:45 PM 5
Share

Clearly this isn't a life or death issue, and I haven't lost any sleep over the extra space yet. But "uglier" is debatable - in fact I know many codebases (and company coding standards) that omit the space between the brackets. Would be nice to have this IDE do the same.

avatar image Bunny83 · May 06, 2012 at 10:15 PM 0
Share

I also prefer no space between the method name and the brackets, that's why i use Visual Studio ;)

Show more comments

4 Replies

· Add your reply
  • Sort: 
avatar image
23
Best Answer

Answer by Lo0NuhtiK · May 06, 2012 at 03:55 PM

In mono go to
[Project]->[Assembly C# Options] -> [Source Code] -> [Code Formatting] ->
[C# Source Code] -> Change [Policy] to Mono , then Click the "C# Format" tab, and mess with the settings in there. That's where you can set the indentations etc for all that stuff.
I just now went in there a couple of minutes ago and found that. Mine was set to "Inherited Policy" and none of the parenthesis brackets spacing like you mention above happened on mine at all.

Comment
Add comment · Show 7 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Lo0NuhtiK · May 06, 2012 at 04:00 PM 0
Share

I'm glad you asked this question... now I have it set to auto-indent my switch statements the way I want it to :D

avatar image Datael · May 06, 2012 at 04:05 PM 0
Share

Likewise I've been wanting these settings for ages! Fantastic! Thanks!

avatar image Drakestar · May 06, 2012 at 09:31 PM 1
Share

Cool, there were a whole bunch of options in there that I hadn't noticed before, hidden in the Category dropdown. FYI, I used the main $$anonymous$$onoDevelop preferences (rather than project-specific ones) in $$anonymous$$onoDevelop-Unity->Preferences->Source Code->Code Formatting->C#. The option I was looking for is first up in the White Space section.

avatar image yoyo · Jun 11, 2012 at 08:24 PM 0
Share

I created a $$anonymous$$onoDevelop policy to encapsulate all these settings and share with the rest of my dev $$anonymous$$m. Works great, except we need to re-apply the policy each time we generate the solution -- anyone know how to change the default policy used by $$anonymous$$onoDevelop?

avatar image dborel · Jan 27, 2013 at 10:35 PM 2
Share

I've created a policy like this, but I have to re-apply it to my solution/assembly everytime I re-open $$anonymous$$onoDevelop. Has anybody found a way to make the changes permanent?

Show more comments
avatar image
4

Answer by badweasel · Jan 19, 2015 at 08:51 PM

Just to clarify something.

If you've already started a project, which you would have or you wouldn't be in MonoDevelop cursing at all the white space, then the Per Project settings will override the main Preferences.

So you basically have to change it in both places. I started with Preferences->Source Code and was super frustrated that it didn't seem to effect my open files. Then looking here I found out that there is also the same setting under Project->Assembly C# Options.

Probably on the next project it would just inherit from the preferences. But to get it to be correct on this project I had to change it in both places.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
2

Answer by jhocking · Mar 15, 2013 at 05:38 PM

The answer loonuhtik gave is correct for per-project settings, but to do it in a global way that will apply to new projects there's the exact same settings dialog under Preferences->Source Code.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Xentor609 · Nov 02, 2015 at 10:07 PM

The problem comes from Unity. In fact it re-generates the solution with the default policy.

I use a workaround that overwrites the contents of the solution. I based on the following link : https://gist.github.com/prime31/35a83fb8ad4eb385ab22

I just found another one that supports mac : https://gist.github.com/Capyvara/9090942

Good luck, Xentor

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

16 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

monodevelop formatting policy to allow single-line 'if' statemetns? 2 Answers

Precompiler directives break MonoDevelop autoformat 0 Answers

MonoDevelop 4.0.1 auto (de)formatting 0 Answers

Stop Monodvelop adding new line when using attribute 1 Answer

Indentation formatting issue in MonoDevelop-Unity 4.0.1 (Win7) 3 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges