Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Group and collapse long code - Like in Visual Studio (#Region) — Gideros Forum

Group and collapse long code - Like in Visual Studio (#Region)

HeliosHelios Member
edited July 2014 in Suggestions & requests
Hello;

As a lot of you probably know, ones code files can easily become cluttered with code. I would love to be able to group and collapse these groups of code to have something more readable.

If you're unsure of what I mean, take a look at Visual Studio's "#Region" thing.

Thanks & best regards
- Marcus

Comments

  • keszeghkeszegh Member
    edited July 2014
    try zerobrane studio ide as your development enviroment.
  • HeliosHelios Member
    try zerobrane studio ide as your development enviroment.
    So are you saying that I should use ZeroBrane Studio because it actually has this feature, or that I should try it out to see if it has the feature? Because I haven't been able to find anything on it.
  • keszeghkeszegh Member
    edited July 2014
    i think you might not be able to make your own groups but logical groups of the code can be collapsed (like a for cycle, a function or a class, etc).
    also you can put a { at the beginning and } at the end of the part you want to group and then this will also be collapsible.

    i recommend you to try it, it's free and small.
    http://studio.zerobrane.com/


  • In Gideros Studio, you can collapse a block (such as a function or a multiline comment) by clicking the minus sign beside it.

    Perhaps the following technique would be suitable:


    Before the block you want to collapse:
    function collapsibleBlock1()
    After the block you want to collapse:
    end
    collapsibleBlock1()

    Sample Pictures:
    1-Before.png
    323 x 507 - 8K
    2-After.png
    329 x 511 - 9K
    3-Collapsed.png
    319 x 103 - 4K
    Kate's Catalogue of Travelling Theatre Centres :
    Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
    She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
  • indeed, gideros ide can do that too, also instead of defining a dummy function, just putting { ... } should work too.

    Likes: Platypus

    +1 -1 (+1 / -0 )Share on Facebook
  • PlatypusPlatypus Member
    edited July 2014
    That's MUCH simpler! :)
    Nice one.
    Kate's Catalogue of Travelling Theatre Centres :
    Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
    She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
  • Collapsed Blocks:
    DummyFunction-COLLAPSED.png
    308 x 105 - 4K
    CurlyBraces-COLLAPSED.png
    298 x 100 - 3K
    Kate's Catalogue of Travelling Theatre Centres :
    Meet Kate. Grey is her favourite colour. Maths is her favourite subject. Decency is her favourite type of behaviour.
    She definitely does not like jewellery or modelling, but loves aeroplanes and other machines made of aluminium.
  • HeliosHelios Member
    Thanks for the suggestions! There's a problem though,- when I use the "{ & }", my code won't run without errors. Gideros's IDE says it's an unexpected symbol.
  • HeliosHelios Member
    Just to show an example of what I mean.
    Cde.jpg
    764 x 240 - 73K
    Cde.jpg 72.8K
  • OZAppsOZApps Guru
    edited July 2014
    @Helios, did you try a do .. end to encapsulate the code?
    do
     your gideros code here
    end
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • HeliosHelios Member
    edited July 2014
    @Helios, did you try a do .. end to encapsulate the code?
    do
     your gideros code here
    end
    This works, but again there's a problem. This time the problem lies with using variables. E.g. I have one "do..end" where I add all my buttons and have button stuff. I have another one with TextFields. I need to get the width of the button, so that I can place the TextField correctly. This is not possible.

    Of course, there are ways around that, an example could be using an extra variable. The thing is the whole idea with the "region"/group thing is having clean, efficient and readable code. You do not get that by having to create extra variables.

    How long would it take to add this feature? Not too long, I think. Please consider adding this feature.
  • HeliosHelios Member
    Bump (Hope bumps are cool).
  • Any news? Can a developer possibly post an answer or something?
  • @Helios unfortunately I think for now no ones concentrating on updating, at least not before open sourcing is completed
  • Do you have any idea on how much longer before the code is released?
    twitter: @ozapps | http://www.oz-apps.com | http://howto.oz-apps.com | http://reviewme.oz-apps.com
    Author of Learn Lua for iOS Game Development from Apress ( http://www.apress.com/9781430246626 )
    Cool Vizify Profile at https://www.vizify.com/oz-apps
  • Unfortunately no.
    As I said I think @atilim already started working on clients projects and that is why it is delayed.
    But knowing that today is @atilim's birthday, most probably not this weekend :)

    Happy Birthday @atilim ! ;)
Sign In or Register to comment.