Script Editor - New Foundation and First Features

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

It shouldn’t be underlining that as a mismatch.

string.char(1)

doesn’t make a differences.

something I wish that would come to the script editor, is external IDEs, correct me if I am wrong with the term usage there, but what I mean by this, is the abillity to use, say visual studio code, or visual studio for scripting in roblox.

before you start ranting at me that rojo already exists, the sole reason I do not want to use rojo is due to it’s complicated-ish setup for me, I’ve never got it working at all, and there is no in detail guide on how to set it up.

edit, one problem I’m experiencing is this,
image
whenever I create a function within another function, the end tag moves one tab forward from where it’s supposed to be.

Excellent. Now I am able to scavenge my errors easier and quicker thanks to this update.

I’m gonna spend most of today (maybe tomorrow) to fix my scripts :sad:

Found a bug with the new editor, on occasion when i’m indenting myself, or studio does it creates a unicode character, which when parsed gives you an error, it’s not an actual blank space.
[Unexpected Unicode character: U+2028. Did you mean ’ '?]
image

1 Like

Had to turn off absolute indentation, as I kept on fighting it when working with functions and other code blocks indented like this:

func(
    2,
    "foo",
    true,
    function()
        return "glue"
    end,
    {
        boo = "hoo"
    }
)

Also it seems that the absolute indentation doesn’t take into account the indentation around the statement it’s trying to absolutely indent, which sometimes leads to indentation going backwards.

Some more control over how the absolute indentation rules work, or using relative indentation as default, would be preferred.

1 Like

Same. Happens to me when pressing Shift+Enter.
I got used to doing it and now I am seeing extra lines.
Please fix it guys.

We are aware and have a fix ready to deploy. Should be resolved soon.

1 Like

it’s not suppose to highlight that as mismtach


that shouldn’t be commented

1 Like

How feasible would a Vim extension/plugin be? As someone who hates using the mouse when programming, I’d really appreciate something like this. I haven’t been able to get a simple transfer from the file system to studio to function (using something like rojo), and that still isn’t a good option because autocomplete for Roblox isn’t a thing in Vim. In addition to that, studio works really poorly in Linux (using grapejuice), so just copy-pasting files is a pain and defeats the purpose of not using a mouse. Honestly, having a terminal based studio extension - or something related - would be a huge benefit to people like me. I don’t need access to objects - I just want something for editing scripts easily with no hassle. Manually clicking all the buttons associated with opening a script, moving around within a script, and committing a script are huge losses of time when multiple changes are necessary in a repeated fix/push/test environment (and even when working on longer projects which require more time just being in the editor). Something that can streamline all this would be huge. This is why I mention Vim - it has keybinds for everything. Studio just isn’t flexible enough for my needs, and I’d appreciate expansion in this direction.

7 Likes

Roblox studio will never be Vim. Even if support for something like that were added, the “Vim like” modes in Sublime / VSCode rarely satisfy users who want that experience, and Roblox Studio would probably be no different.

Use Rojo for this, it can automatically reflect your scripts out to files to enable editing in Vim. Wanting to use Vim for your editing is almost the optimal use case for using Rojo.

3 Likes

All right. Funnily enough, I finally got rojo functional yesterday. It has been much better than I hoped. There are some shortcomings - such as needing to have studio open (which overheats my laptop in Linux for a variety of reasons) when keeping the connection open, but I can merely edit offline and then push the updates at a later time.

I’ve never really tested the Vim plugins/extensions for those other editors. I just knew they existed and was curious about whether or not it could be feasibly done. Thanks for the info. :slight_smile:

1 Like

Is there a glitch now that the current one will not auto-indent after starting a function/statement? Or do I have a setting off that I do not know about?

1 Like

Since this morning indentation inside functions has been a little glitchy

5 Likes

White-space view thingy I love it, but in large scripts like over 100-500+ lines are lagging like heck. Could Roblox Team try to optimize the performance with larger scripts? Because VS Code has it and it doesn’t lag with 5,000+ lines, so it is possible, just saying. Also working with scripts that are 10,000+ lines big, are lagging so much I can’t even use Roblox Studio (this is both an issue with and without white-space feature), so I would like Roblox Team to optimize that one too. But overall update is great!

3 Likes

Maybe those white-space dots should be optional, but I personally find it useful and I love it.

3 Likes

I been waiting this for long! :sparkling_heart::sparkling_heart::sparkling_heart:

1 Like

I don’t support this. Why would you use the tab key to insert spaces? Usually, you can just hold your space key if you need them that badly, or just tap the space key a few times if you don’t need that many.

You use alignment as an example, but if you change the tab key to only insert spaces, you will have to use spaces to indent (which is bad). I believe the tab key should insert tabs, and the space key should insert spaces. Indentation should be done with tabs, as one tab = one indent, always, and spaces can be used for alignment.

Note that using tabs for alignment is a sin that should cast you away into the deepest depths of the underworld. Tabs are for indentation only and you should always use spaces for alignment. Complaining that the tab key inserts tabs is like complaining that the space key inserts spaces. Or complaining that the enter key inserts newlines instead of carriage returns.

The greatest reason to use tabs is consistency. A popular belief is “tabs are bad, because you can never count on their width”. This won’t be a problem if you only use spaces for alignment. Have an example of smart indentation, where tab characters are represented by 🠒 and spaces are represented by ·:

(please note that this does not represent any particular coding style, it simply illustrates what smart indentation looks like)

🠒	local·x,
🠒	······y,
🠒	······z·=·5,
🠒	··········6,
🠒	··········7

🠒	print(x,·y,·z)

At no point do you use tabs for alignment, but at no point do you use spaces for indentation. Using both tabs and spaces cleanly separates the two. Here’s another example:

🠒	local·x,
🠒	······y,
🠒	······z·=·5,
🠒	··········6,
🠒	··········foobar(
🠒	🠒	··········1,
🠒	🠒	··········2,
🠒	🠒	··········3
🠒	··········)

🠒	print(x,·y,·z)

Or optionally:

🠒	local·x,
🠒	······y,
🠒	······z·=·5,
🠒	··········6,
🠒	··········foobar(
🠒	··········🠒	1,
🠒	··········🠒	2,
🠒	··········🠒	3
🠒	··········)

🠒	print(x,·y,·z)

although I find the former cleaner.

This post feels like a mess, but I hope you get the point. This coding style allows the reader / contributor to choose any tab width they like. Most people go with 4 spaces, which is sensible. Some people like 2 spaces, which is a little too small for my tastes, but still an option. Some people like 3 spaces, those monsters. Maybe you might even want 8 wide tabs. The code doesn’t judge.

Meanwhile, space indentation is rigid. Maybe you indent with 1 space and I can’t properly navigate the codebase. Maybe you indent with 8 and it’s too wide for me. Tabs would have given me the option to change it, without impacting your codebase at all. Because 1 tab = 1 indent. The only true way to structure your code.

1 Like

Great work on all these updates! One question though…

Are there any plans to allow users to customize the types of whitespace that are visible? Personally, I would like to only see a line indicating indentation level - anything else is unnecessary for me.

Have you also thought about having some small tips pop up for newer users? (Think PyCharm) This way, newbies could choose to turn these features on or off and (hopefully) understand Roblox Studio better.

Many significant and well respected editors allow for this behavior and some even have it as the default. Inserting spaces with the tab button is not ridiculous at all, and I highly recommend you do some research before you do a rant about why you think it’s bad. It has many positives, and you wouldn’t have to use it. In fact, developers who use spaces instead of tabs make more money on average. This can be due to a variety of factors, but they are irrelevant to the discussion at hand. I find it absurd that you would heavily criticize a reasonable suggestion that was merely proposing an option, not even forced behavior for the editor. This is a debate that has been going on for quite some time, and you’re not going to resolve it with your personal opinion. Sometimes it’s best to just allow people to have the option to use what works better for them. Why would you even care?

2 Likes