Search Unity

Don't have possibility to fold code in monodevelop?

Discussion in 'Editor & General Support' started by Nirvan, Jan 11, 2014.

  1. Nirvan

    Nirvan

    Joined:
    Nov 16, 2013
    Posts:
    134
    Hi, I want to fold many parts of my code in monodevelop and I don't have "+" squares and "fold" options are gray.
    I programming in C#.
    There is screen: http://imagizer.imageshack.us/v2/800x600q90/826/dn69.png
    I made #region ... #endregion and can't find solution to get this.
     
  2. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,619
  3. crawler

    crawler

    Joined:
    Aug 9, 2012
    Posts:
    27
    Folding doesn't work in Monodevelop 4 with Java for me.
    How can I use #region ... #endregion in Java?
    Thanks!
     
  4. Dustin-Horne

    Dustin-Horne

    Joined:
    Apr 4, 2013
    Posts:
    4,568
    I'm not sure if you can use region tags with javascript, or at least you used to not unless it's been added and I'm unaware.
     
  5. anlop

    anlop

    Joined:
    Jun 16, 2014
    Posts:
    1
    I don't know how to do it in JS :(

    In C#:
    Tools -> Options -> Text Editor -> General, and tick "Enable code folding".
     
  6. Eklavyaa

    Eklavyaa

    Joined:
    May 4, 2014
    Posts:
    20
    thanks Anlop...:)
     
  7. devstudent14

    devstudent14

    Joined:
    Feb 18, 2014
    Posts:
    133
    Thanks guys. I was wondering how to do that. When I press enter though one of my regions keeps popping open. Does anyone know why this is? The region is the in the void Update() method if that means anything. However there is another region in the void update that does not open when I press enter anywhere in the code.
     
  8. jashan

    jashan

    Joined:
    Mar 9, 2007
    Posts:
    3,307
    Do you mean Java for Android development? Because Unity doesn't support Java.

    JavaScript != Java ... actually JavaScript in Unity != JavaScript; the language is actually called UnityScript. But most people (including UT ;-) ) call it JavaScript. Just remember it's a different language than what you're using on the Web.
     
  9. Jackol

    Jackol

    Joined:
    Apr 8, 2015
    Posts:
    3
    It makes me sad because I just want code folding for Javascript functions so it's easier to read. All well~
     
  10. Ian Scarbrough

    Ian Scarbrough

    Joined:
    Apr 21, 2015
    Posts:
    1
    Just wanted to say I found out how from another site in case anyone is still wondering.

    In MonoDevelop

    Click Tools -> Text Editor -> General

    Tick the box you wish regarding folding.
     
  11. Somian

    Somian

    Joined:
    Nov 22, 2011
    Posts:
    38
    I tried that but it still doesn't work. The text editor gets wider, but how do I fold code?
     
  12. Wailor

    Wailor

    Joined:
    May 2, 2015
    Posts:
    5
    I realised code unflolds after saving. Is there any way of preventing this from happening?

    It's a bit annoying, as I tend to save a lot hahaha
     
    03gramat likes this.
  13. 03gramat

    03gramat

    Joined:
    Aug 27, 2012
    Posts:
    3
    I am also seeing this problem and it just generally makes it annoying to work with because I like to keep everything saved while I check over the stuff i've written.. like a normal person :p
     
  14. TraumaCenter

    TraumaCenter

    Joined:
    Sep 22, 2015
    Posts:
    1
    If you lose the ability to fold code after saving just make a small change, like pressing space somewhere then it should pop back up... to keep code folded through saving you can use #region I think it makes it a bit nicer to manage overall really. (Also you can set the options to automatically fold regions when you load a script in monodevelop)... which is very nice.
     
  15. PianoMeow

    PianoMeow

    Joined:
    Sep 26, 2015
    Posts:
    107
    heres an update for this
    Monodevelope:preferances:TextEditor:General click the box to enable code folding(to have them closed after saving also check the box for fold on default)
     
    mrnobody93 and Ewakhine like this.
  16. Deleted User

    Deleted User

    Guest

    TYVM
     
  17. alarm656

    alarm656

    Joined:
    Jul 6, 2013
    Posts:
    111
    Cool thanks anlop! in new Monodevelop or OS X. Preferences -> General