Script Editor should save which folds are collapsed and expanded within/between sessions

If I want to collapse certain folds, I want them to stay collapsed. I don’t want to have to collapse them all over again every time I close the script and open it again.

34 Likes

This was kind of asked before, but you may not be pleased with the “solution”:

Perhaps the idea needs revisiting.

1 Like

Hi,

My experience as a Programmer using RobloxStudio’s Script Editor is quite a nuisance compared to other Platforms and Editors;

Currently the Script Editor will not save the status of Script Folds after or even during the session, if you reopen the script all folds are expand.

https://gyazo.com/d78920d711974738a0baced4d6a8adf0


Adding this would increase quality of the Script Editor and improve User Experience, and would also save Developers time and provide easier organization, currently to avoid scrolling over a huge script with a lot of Content, you can either deal with it or create another script which isn’t very optimal.



12 Likes

Functionality like this would make settings module scripts in free models much more intuitive to new users since they will not be bothered so much by syntax characters and can look more at the direct hierarchy of the script / table within the script. (Not that this is really that important since it’s probably better that new users are exposed to code format anyways)

The issue I could see with this is how exploiters could publish models, close flaps with malicious code in them, and the person who inserted the model doesn’t see the closed flap because the script is 4000 lines long, allowing a backdoor.

Both of these would be prevented if folds didn’t save with the model, and instead only saved in studio for the next time that you open the script, which I think is what you’re asking for but I just wanted to clarify.

Additionally something like this would so nice that folds would become less relevant anyways:

The outline lets you select global functions and variables in your code and easily navigate large scripts. It’s in about every other script editor so I don’t see why it wouldn’t be in roblox

1 Like

I understand your concern and I appreciate the thought,

Firstly to prevent malicious code there can be a setting which is On by default to Expand all folds when importing Code from the Toolbox, and such.

However in general saving the folds status to our Game file both Online and Offline would be great, I am not sure about how multiple user sharing and editing, Teamcreate, Packages, should work in this regard but it’s their job to figure it out.

5 Likes

Recently I made a post about this, then a post approver informed that a topic like this already exists, that’s why I wanted to add up to this feature, and hopefully revive it, because this is from like 2016.

At the moment this is quite annoying, especially if you have a huge chunk code that you wanna forget about for a long time when dealing with other stuff in that script.

When a scope is closed like this
RobloxStudioBeta_XeupxxLGjg
If I close this project then I open it, or hit play then stop the game and go back to the script, it’s opened.
image

Can this please be changed so It stays the same even after opening it again?

2 Likes

When you are working on a script, you have the option to click a little triangle on the side of the screen next to the line numbers to collapse the following block of code. This is super useful for making a giant script much easier to compartmentalize and manage individual sections without easily getting lost in the code. I find this especially useful for collapsing entire functions in modulescripts that often contain dozens of functions.

The problem with this (or what I believe Roblox Studio currently lacks and desperately needs) is the ability to remember which of these blocks you have expanded and collapsed. Whenever you close out and reopen a script, all of the blocks which you had collapsed are re-expanded, which makes it difficult to continually work on one script over multiple sessions without having to remind yourself which section of code you were working on.

2 Likes

Yep, still in need of this. My character script is at 250 lines right now, with most of it just being bulky sanity checks and input bindings. It will probably reach 600 by the time I’m done and it already takes me 5 minutes to set up the environment to start working.

I’m currently forced to write an API documentation for each script that barely has 8-9 methods (which often change as I work), just because I’d have to scroll down every time instead of folding the functions.

I would actually use the fold collapse feature if collapsedness saved. Currently, it’s just too much of a hassle to bother. It would make it much easier for me to navigate my code if I could just hide and leave hidden stuff I don’t care about.

2 Likes

As a Roblox developer, it is annoying having to re-collapse portions of code you had collapsed in a previous session of working on that script. For example, if I collapse a function in a script and then close that script and re-open that script later on, that previously collapsed function is expanded.
Sometimes I’d like to collapse several portions of code, however when I come back to working on that code later on I have to go through the script once again collapsing those portions.

If Roblox is able to address this issue, it would improve my development experience because it would help me focus more time on working on my code rather than devoting part of it to re-collapsing portions of code that I had collapsed in previous sessions.

Example of this currently annoying behavior

5 Likes

As a developer, it is annoying that scopes that I closed before closing studio will not remain closed once I open studio again.

If this issue was addressed, fixing this would definitely make life easier.

This post has been out for quite a while now, bumped several times, yet it didn’t get any attention all this time.

5 Likes

I dropped using Visual Studio Code and Rojo recently because it’s a hassle, and switched to just using the Roblox script editor. Code folds not saving is the single most annoying problem I have with the script editor right now. Fixing it will save me, and everyone else so much time.

3 Likes