Script Editor - New Foundation and First Features

I’m also experiencing this issue!

https://gyazo.com/d8b9c85da5e094644d68d7f83dde39d6

Amazing update. I am glad that this is released.

Thank you a lot. So many times I had to copy and paste some code throughout scripts and have to fix the intent of the code block.

This can be a useful feature. I cannot think of a use right at this moment, but I bet this will be useful in the future.

Something that I would love to see being added is a comment shortcut like in VS Code. You can press Ctrl + / in order to single comment lines, or Ctrl + Shift + / in order to make a comment block. This would be very useful.

Another thing that I would love to see which is probably not going to happen is multi-line editing. You can put your “cursor” (the little line that indicates where you are on a text document) in multiple positions and whatever you do will affect all of those lines.

Other than my suggestions, I appreciate this update, especially these ones:

Cheers and thank you.

2 Likes

This will be very useful for new developers as they will learn how formatting code really looks like and the reason behind it.

unknown
it seems like commenting code and pressing enter after it does what is shown in the image
it pushes the commented end forward, alongside the – that marks it as a comment

I believe you can already comment lines by pressing ctrl + shift + c (press them again to uncomment)
it works with multiple lines

3 Likes

Done.

Duplicating line request is here. Deleting line request is here. Toggle for spaces vs tabs is here.


My best guess is that it’s unary minus, meaning minus (-) with one operator. It’s a bit of a dumb name to expose in error messages, but it’s the internal name. You could file a feature request to change it if you want.

As @kisty1 said that shortcut already exists in Studio. You can actually customize it to be Ctrl+/ by going to Customize Shortcuts... in the Advanced menu of Studio:
image
From there just search Comment and set it to Ctrl+/.

3 Likes

Thanks for the feedback. Improvements scheduled for this.

4 Likes

I am very happy about this update! One thing I would love though is if the whitespace setting was split into three, allowing more control over where it is visible. I personally don’t want to see whitespace between keywords. Great update overall.

3 Likes

That is already possible, click and drag the script title at the top when the script is open.

3 Likes

This is literally my 2nd favourite update.

I remember those nights at 2am where i’m trying to fix 1 bug and I had the stress of worrying about proper indentation & readable code while crunching my brain tying to fix the bug.

Thanks everyone who worked on this feature!

3 Likes

Hey, does the error actually cause any disturbances to using the new editor?

I haven’t seen this error yet myself but is their a way to replicate it?

1 Like

The technical term for this is leading (start) and trailing (end) whitespace. I don’t know the term for other whitespace but being able to separate them out into three categories would be very useful imho.

1 Like

Has the following issue that I addressed recently been fixed?

2 Likes

I had no idea this existed in Studio. Thank you for pointing it out.

2 Likes

Thanks for letting us know! This is going to be a huge timesaver for me – I need to learn about all these kinds of shortcuts that’ll improve quality of life in the Studio :slight_smile:

2 Likes

Really awesome that you are working on this! The editor is really the primary tool for scripters, a good editor saves so much time and prevents so many bugs.

It would be really nice if some more hooks into script editing were somehow opened to plugin scripts.

Also, there is one feature I personally would >love< to see regarding the auto-complete. Even if the type of object in a variable is unknown, if I start typing :FindF or :WaitF then you can be pretty sure I’m looking for :FindFirstChild( or :WaitForChild(… And similarly suggestions/autocompletions for other ROBLOX idioms/ highly used API elements like this (especially the wordy ones) would make us so much more efficient. Also perhaps a better way to quickly find enums would be very helpful.

These are by no means demands, I just hope my feedback can be helpful. I do all my scripting in studio, and editor features mean a lot to me. But I also see a lot of new developers having trouble to find or read the API, indent properly, and all those tiny things that a good editor gives you just a little (or big) edge in.

Thanks for improving our scripting editor!
Nonaz_jr

3 Likes

yoo this is fancy. loving it so far!

1 Like

Took you long enough to stop detecting comments that contained do, then, function or repeat as collapsibles. I finally don’t have to avoid using them or capitalize them anymore.

1 Like

The “unm” error is a legitimate syntax error that arises when trying to negate a function (or anything else that can’t be negated).
An example is:

print(-math.random)

Notice the lack of parentheses after the random function. This always used to throw an error, it’s just that now it includes the weird “unm” thing in the error message.

1 Like

One thing I would love to have in the new and improved script editor are “regions” so we can keep our code more organized than ever. Like regions in Visual Studio 2019 as shown in this GIF example: https://gyazo.com/f39e4506861bb202a771f0141895bb09

2 Likes