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
12
Question by hamstar · Nov 13, 2013 at 10:08 AM · c#monodevelopformattingpolicy

Stop Monodvelop adding new line when using attribute

This may be a question for the Monodevelop team, and I will email them if no one here has an answer. I thought it would be useful to ask the question here, as I imagine other Unity users are having this issue.

Since the upgrade to Monodevelop 4.0.1, when I format my code it adds new lines where I have used attributes. I have not been able to find a setting to change this behaviour in the C# source code Policy settings. Does anyone know a way change this?

Here's an example of how Monodevelop is adding new lines and indentation:

 float one;
 [SerializeField]
 float
     two;
 float three;
 [Range(0.0f, 1.0f)]
 float
     four;

As you can see it looks a bit odd and wastes space.

Comment
Add comment · Show 21
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 Garrettec · Nov 26, 2013 at 04:06 PM 0
Share

Looking answer for the same issue, so if you'll find out the answer - write it here, please.

avatar image LightStriker · Nov 26, 2013 at 04:13 PM 0
Share

You could use Visual Studio... The Express version is free.

avatar image hamstar · Nov 26, 2013 at 04:50 PM 0
Share

I didn't get a response from monodevelop by email. I will try the mono forums.

avatar image Garrettec · Nov 26, 2013 at 09:53 PM 0
Share

to LightStriker:

Unfortunately Visual Studio is not able to debug without UnityVS plugin, which seems have some issues too (I have tried it several months ago and Unity Editor hang every time I wanted to close it). And mono is the tool "out of the box", so I see no reason not to use it. Just want to know how to overcome this inconvenience with new line.

avatar image dc · Dec 31, 2013 at 06:14 AM 0
Share

I need a solution for the same issue too. Couldn't find a way to change that. Anyone?

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
-2

Answer by Rob Porter · May 19, 2014 at 11:27 PM

NOTE: THIS ANSWER IS WRONG, IT EXPLAINS HOW TO DO SOMETHING COMPLETELY DIFFERENT

In MonoDevelop:

MonoDevelop-Unity -> Preferences -> Text Editor -> Code Templates -> "Attribute" (It's after "~")

There are a ton of formatting options buried in the MonoDevelop settings -Sorry I don't know them intimately enough to go into great detail for you.

All I can say is:

Before doing anything, make sure you know how to revert your changes back, or at least reset to standard settings!

Comment
Add comment · Show 4 · 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 hamstar · May 20, 2014 at 06:50 AM 0
Share

I don't think that's what we're looking for. It looks like that's the template for attribute definitions (not usage).

avatar image Mizipzor · May 20, 2014 at 11:03 AM 0
Share

That has nothing to do with the question. Those settings are for the code templates (hence the name) for quickly creating new attributes, not the settings for how a field decorated with an attribute is formatted during automatic code formatting.

avatar image Rob Porter · May 20, 2014 at 09:13 PM 0
Share

oh sorry, i didn't realise. should i delete my wrong answer?

avatar image Tseho · May 22, 2014 at 09:33 AM 0
Share

At least, edit it for explaining it's not the answer we were expecting. Other people will find this discussion on google if they have the problem and you can be downvoted.

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

31 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 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

MonoDevelop Doesn't Remember Policy File 0 Answers

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

Unity2d Top Down: Can't move character with Animator enabled 0 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