We talked a few months ago about the new Script Editor we’re working on (The Script Editor). Well, now it’s starting to become real! With this release, the new architecture is live in Studio supporting several features. The full transition will be gradual and take place over the remainder of 2020. In addition to more visible improvements, you may start noticing the Script Editor get progressively faster, more responsive and less…quirky.
Folding and Formatting Improvements
As of today, code folding and auto formatting (including auto indentation and auto code block completion) are being driven by the new engine. Specific upgrades include:
The script sidebar no longer displays fold indicators for code blocks that are not collapsible
An extra line and indentations are automatically added when enter is pressed between a pair of curly braces for table syntax
Auto code block completion is smarter about nested code blocks on the same line
Auto indentation is smarter about aligning the closing line of a code block
Auto-Indent is Now the Default
The default settings for auto indentation have been changed to an “absolute” indentation rule. It corrects the indentation level to maintain proper formatting. For example, starting with this code and pressing Enter…
…will result in corrected formatting
If you don’t like this behavior, you may switch back to the old “relative” indentation rule in the Studio preferences.
Seeing Spaces (and Tabs)!
Viewing the examples above, you may ask yourself “Are those lines indented with tabs or spaces?”. And up until now you would just have to guess - but no longer! Now there is VISIBLE WHITESPACE. You can turn this goodness on with the Studio > Script Editor > Show Whitespace settings.
We will have more improvements here soon. For anyone dealing with some unholy mixture of spaces and tabs (shudder), selection formatting and whole document formatting are coming. Hang tough!
Moving Blocks (and Lines!)
We’ve added hotkeys to move blocks of code up and down. Alt+Arrow Keys (Opt+Arrow Keys on Mac) will do this now. Using these hotkeys without a selected block will move a single line up/down. Keep those hands on the keyboard!
This is good to hear! I think I’ll like the absolute indention, I need my code to be organized neatly.
The new improvements are a real nice touch! I don’t see a need for whitespace, though. Spaces and tabs, I think both work fine if it’s spaced neatly. I’m definitely gonna make use of the moving blocks feature though, editing scripts will be easier than ever!
I don’t like the dots in between words like that, I don’t really see much of a use for it and it seems to clutter everything up. All I see from that is Morse code, which I don’t even know at all LOL.
Also, it’d be great to have auto-complete detect objects nested within other objects. Right now it only works until layer 2, and then there are no suggestions deeper in.
Another thing: I’d love to toggle between relative and absolute indentation via a hotkey because there are frequent use cases for both and I don’t feel like going to the settings tab every so often. So, a keyboard shortcut would make it so much easier to properly indent your code. I mean, it can annoying with the absolute indention, and same goes for relative.
Yes, finally a quality update when it comes to us programmers on ROBLOX!
Indents and formatting will be my personal favorite since it will make the code much easier to read and well organized for programmers around the community.
Sweet, this feature will be useful to see how many “tabs” you have done or the indents on the script.
Good. It’s hard to help people debug in #help-and-feedback:scripting-support when their code isn’t indented properly. Glad to see changes that benefit the platform as a whole.
Not personally a fan of the whitespace indicators, though. They don’t stand out as much as I’d expect.
I’d prefer this (above) look closer to this (Notepad++):
The tab indicators are more clearly defined, and the spaces aren’t off-center like in the Script editor.
Yes! Scripting in roblox just got way better!
Though, how many of these features have just been completely rolled out, or are they gonna be added to beta features list?
This feature is gonna be awesome for me, whenever I do tables like this I always have to press tab to indent another line. Thanks for the other features!
Do you have “Show Whitespace” on in your settings? Because that’s what causes it. The whole point is to see the whitespace in your script.
Other than this, this is a great update to the script editor that fixed a bug I commonly saw that indented another level when hitting enter from the very front of a line.