Script Editor - New Foundation and First Features

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

Why is the highlighting so sensitive? I try to highlight a single word and it highlights 2 to 3 lines this makes it super frustrating to use the new editor.

Yes, I am aware of this. Some editors don’t even give you a choice, and force spaces. Even the maintainers of the Python programming language have said that they wish they could go back and forbid tabs at all. But not for any particular good reason - simply because some people can’t see the difference between tabs and spaces, and mixed indentation became a problem when people tried to use spaces and tabs in different parts of the code, creating ambiguity as to how many levels a tab is, if, for example, you use 2 spaces in other places.

However, this ambiguity is not a reason to avoid tabs - it only shows up when you try to mix spaces (which are exactly 1 unit wide) with tabs (which are used to represent the concept of “1 indentation level”, which could have any width visually).

What kind of research did you do? You looked up articles about how much money they make, which has no relevance. In fact, large, “enterprise-y” corporations make bad technology choices very often, like using Windows Server, or Java.

Want to know why? Because many large companies including Google have strict rules mandating the use of spaces instead of tabs. But that doesn’t mean they’re better.

Using multiple spaces per indent increases source code file size, enforces opinionated rules on indentation size, makes it ambiguous as to how many spaces actually make up an indentation level and so on. Some companies even use multiple different widths of indentation which makes it even more confusing, i.e. classes indent by 1 space, functions indent by 2… I’ve seen this before, for real, look at the Processing source code, it’s a complete mess.

Actually a few people have already told me that my arguments for tabs have convinced them to switch. Many of the arguments that support spaces don’t make sense, i.e. “they’re not consistent because they could be any width”, or “they’re control characters and therefore bad!”…

Why would you? Why do you feel the need to upon seeing my post release your own rant about how stupid it is to criticize an option supporting both sides of a debate that’s been happening for “20 years” (according to your own source)? Honestly, I understand how it looks stupid. But I stated my opinion for the same reason you did: because someone said something I objected to and I wanted to tell that person what I thought about it.


All in all, I don’t support adding support for space indentation in the Studio editor. If someone did decide to do it, then collaborative editing will become a mess as everyone’s indentation settings conflict. Those indentation settings are global - encounter one script with 2-space indentation and you have to change your indent type and your indent size for all your scripts. Or mess it up with a mixture which is probably what many people will do.

1 Like

Just something to note in this argument: While Roblox Studio should support inserting spaces for tab, that’s not the convention that Roblox’s Lua code uses. All official Roblox Lua code uses tab characters, so if you want your code to mesh as nicely as possible with potentially forked pieces of Roblox code tabs would be prefered.

6 Likes

I just cited a few arbitrary articles to show that people like either side. If you want more, just go look. There are many. It was not an attempt to argue against you or for a particular side. I just find it ridiculous that you would be so opposed to an optional feature that is supported (and even enforced) by many highly qualified platforms. You seem to think that I thought the articles I provided somehow were arguments as to why spaces are better. I personally have no stance on the matter. I’ve used both in multiple editors and have seen the benefits and downsides to both approaches. My post was merely to demonstrate that a reality where people use other methods does exist and isn’t necessarily bad.

Your argument basically boils down to your dislike for what would happen in collaborative editing and working in different codebases. Do you know what collaboration is? It’s working together towards a common end. You can sync settings (whether to be tab-based or space-based) so that both sides are working with the same formatting. It’s not that complicated to do.

I honestly don’t see why you’d be so heavily opposed to this optional setting which has downsides that can be easily resolved. To tnavarts’ point, you can just switch your settings when working with a particular codebase. I will reiterate what I said earlier: I am a neutral party in this matter. I don’t even use the Studio editor. I just think that optional features that improve development for certain users should be encouraged and added (certain discretion is necessary, of course, but this is clearly an instance where it would do more good than harm for professional developers). I believe this just like I believe Roblox Player and Roblox Studio should be ported to Gnu+Linux. I think many developers would benefit greatly by being able to test their games etc. in the many development oriented operating systems that exist. But I digress. I just think you should chill.

Hi gillern,

Thanks for reporting! Yeah this is side effect about fixing another parentheses issue, and we’ve located this issue, will release fixed version soon!

Im not sure if this is a bug exactly, but is there a reason it always makes an extra ) after you do a function?

like for example a remote event function.

Hi, @GeneralRelish, @PaintedGardener, @tnavarts, @yohooyohoo, @cruiser_forever

We desperately need better IntelliSense support for ModuleScripts, stored Variables and the ScriptEditor in general