Script Editor - New Foundation and First Features

Is there any plans to make existing code blocks automatically indent themselves if wrapped in another block? (something like this)

It’s currently quite annoying to indent all of the existing blocks manually. Multi-cursor could also solve this issue but it’s also troublesome because then you end up adding white space to empty lines.

Might I suggest a 3rd mode for showing whitespace? Currently in the Studio script editor, whitespace is shown for every empty space. Personally, I do not want to see whitespace in every scenario, such as between keywords and in strings, as examples. I see viewing whitespace as a tool to see that all code is aligned properly. I would rather see the whitespace in larger gaps of spaces, such as in tabs. Visual Studio Code has 3 (or 4) modes for viewing whitespace:

Mode 1: No whitespace is shown. This has been the default in Studio.

none

Mode 2: All whitespace is shown. This shows all whitespace in the script editor and is currently what Studio’s editor supports and is referred to in the parent post.

all

Mode 3: Whitespace is shown in instances where 2 or more spaces are present. This helps clean whitespace clutter in places like strings and between keywords where usually one does not need to see that there is whitespace. Pay close attention to the strings and keywords in the following screenshot compared to the screenshot in Mode 2.

boundary

Additionally, VS Code has an option to show whitespace only for the selected text. I don’t know how necessary this is, but here is an example gif:

selected

In addition to this suggestion, I would like to point out that Studio’s current editor has no option to use spaces instead of tabs. Many programmers prefer spaces over tabs yet still use the tab key as it is a quick way to insert 4 (or 2) spaces in most editors if configured to use spaces instead of tabs. Could we have the option to change the tab key to insert a variable amount of spaces in lieu of tabs?

An example of where this would be useful is as follows:

In this example, we can see that using tabs can be a bit cumbersome as lining things up with a mix of spaces and tabs is quite messy and cumbersome:

tabsspaces

Additionally, if the name of the variable is changed later, it can really mess up the formatting set up in the gif above and the programmer must fight the mix of spaces and tabs to get things to line up again. However, if the programmer sets their editor to use just spaces, it makes things much simpler are things are more consistent.

QVEGjxmdiU

Additionally, if the name of the variable is changed in this scenario, it is easier to align things as the programmer would not need to use a mixed space/tab system.

Finally, it simply looks nicer. Look at what mixed spaces and tabs can look like:

And here is the same example with just spaces:

Wow, that’s a large reply, but I hope it shows that these are important features to myself and many others (I hope!). I am not sure how hard these features would be to implement, but I would assume that they would be pretty basic additions to the script editor.

Thanks!

4 Likes

This is a Awesome feature to have in Studio! It will definitely make scripting much faster!

You can only drag one window off at a time. It would be nice if you could drag a window out wich contains all the script editors. It would also be nice if it functioned more like a normal window with a fullscreen button etc.

3 Likes

I remember auto-indent having troubles with elseif blocks in some cases, has it been corrected?

1 Like

Love the improvements to the indentation system, much better !

But I accidentally closed studio again looking at the new settings cus of this popup, please get rid of it! Make 'Restart' window after changing settings smarter

This will make Coding Easier TY :slight_smile:

On the track of improving scripting Quality of life; another good idea is when you copy and paste blocks of code, the Block gets properly Tabbed within the code its pasted into?

1 Like

I noticed one day that the editor was highlighting “Unused Variables”. I loved it! Sadly it disappeared. Was it some sort of A/B testing, like it’s a feature coming soon?

1 Like

I get the same error when ever I do shift+enter, its annoying sometimes.

2 Likes

Would it be possible to make it so CFrame doesnt get highlighted when its a key?

Capture

6 Likes

Niceeeeee updateeeeeeee :clap: :roblox_light: good job roblox.

1 Like

Thank you for the feedback, we’re revamping syntax highlighting and this is a good suggestion!

8 Likes

The script editor needs better horizontal controls. I’m trying to select a part of a long line of code, but the script editor keeps snapping all the way over to the right making it really tricky to select what I want to select

2 Likes

The script editor should show suggestions of the first variable in OnServerEvent for RemoteEvents and RemoteFunctions.

RemoteEvent.OnServerEvent:Connect(function(player, var)
    player. <- here
end)

Since the first value passed by RemoteEvents is always the player that fired it, its safe to assume that it will be a Player object.

These updates are really great! I have noticed the auto-complete showing up a lot more than it used to, and the auto-indenting is great.

Wow! How i lived without this feature?
Just look at my code for vip settings, it looks very readable :o

Only a little problem… Maybe better don’t show this whitespace, when it’s small?

Guys, use double click selecting, it’s my little lifehack.

This news is just awesome! I’m personally a huge fan of the whitespace indicators, and the refined auto-indent is a godsend!

Great job!

I dunno lol, not knowing if it’s me breaking stuff or Roblox or both of us is a crazy way to develop but this is cool so far, and I’d like to see all the other suggestions implemented as well as something like Alt+Shift+Arrow Keys to jump a block over or under another block regardless of block length if a block is selected. I also learned a lot from reading this thread.

When I press enter after an if statement, it auto-completes the end, but also un-collapses/unfolds all collapsed code underneath it.
Example:

local function doThis(variable) -- when I press enter here, the functions below it open up

local function doSomethingElse(anotherVariable)
    --code here
end

This gets annoying in scripts with lots of functions, if statements, etc. When I added a new function at the top of my script, all of the functions below it opened up, even though I had most of them closed.

Also, should I keep posting here or make bug reports? I sometimes find small bugs like this one and I’m not sure whether I should make bug reports or just reply here.

Please make a formal bug report. We watch these threads but a bug report provides a more detailed definition of the problem, which makes it easier to design a comprehensive solution. :smile:

1 Like