Script Editor: Luau-Powered Autocomplete & Language Features Beta

My goodness yesss, it’s beginning to be more like visual studio or other code editors that have this smart auto-complete, makes things so much easier.

1 Like

Love it, it’s perfe… Expect for one main issue.
Take a look at the video below, I’m so used by memory just typing out “else” and typing enter, now with this autocomplete else turns to ElapsedTime() if I don’t press space! I don’t see how, as else isn’t in Elapsed other than the first 2 letters. If you could fix this, it would be great!

15 Likes

Was just going to make a post about this on here. Having the same issue.

1 Like

Because you are using Absolute indentation rule, ScriptEditor will suggest indentation respects to whole code structure.
You can do document formatting to make it clear.

1 Like

Not only do I think the giant fonts is a downgrade, but it also seems like the auto-complete is super inaccurate.

image
I rarely reference ReplicatedFirst… ever.


This is ridiculous… You can’t connect to anything other than a function. Why isn’t it the first result?

Yet another example, here:

image
Here, I have to press the return key twice because auto complete is still active, despite there only being 1 result and I’ve already typed it…?

It also feels like some recent updates have made my script editor much slower. My main client script is 4,000+ lines long. It’s clean, it’s organised and I was able to write to it efficiently. Now, every keystroke feels much more delayed than it ever has been!

10 Likes

Ok. Ok. Ok.

I just tried out the new thing by enrolling into the beta.
The text size is honestly… Looks rubbish because its too big.
And some other bugs that salcret told in the reply above me.

Otherwise ok. Please reduce the text size of the auto-complete as it looks disgustingly big and bad.

1 Like

This is instantly a win for me just because I no longer have to type :WaitForChild() everytime now. THANK YOU DEVS!!!

Although, it does seem buggy still. For instance, it was able to autocomplete almost everything on my UT variable, but it stopped working once I got passed “ClayLibNMS”:

Also, here’s a picture of me trying to find the Enums/Properties for my utility script:

3 Likes

You most defiently don’t need that many waitforchild no matter what

3 Likes

Any chance you can make this UI wrap or take up less space? Right now the autocomplete fills my whole 2K monitor (with 125% scaling) farily quickly:

Sidenote… I’m glad this takes in information on untyped (i.e. --!nocheck) modules, as I’ve been relying a lot on binding information with the old system. I got surprisingly further with the luau autocomplete on my no-check testez alternative than the older binding-based autocomplete!

I’ve been skeptical about enabling these luau-powered features (specifically the Alt+F find replacement) because it actually tends to provide less suggestions with typed information than with binding-based information. It looks like this is not the case for autocomplete?

1 Like

Do you have examples of Luau powered features returning fewer (or otherwise inferior) results compared to their legacy versions?

The Script Function Filter (Alt+F) was subject to a few deliberate behavior changes. Most notably, it was changed to not suggest functions which are not accessible from the current script. Previously, it iterated through every script in the place to populate the list.

Generally speaking we expect Luau Autocomplete (and the other Luau powered features) to provide strictly more suggestions, in more contexts (except perhaps where old suggestions were incorrect).

Try replacing each %s in the format string with %d.

%s is for strings and %d is for integers. It works at runtime because string.format automatically casts numbers to strings.

Speaking of, I also found a bug when you made that snippet: ("string"):format's type checker skips the first argument:

W000: (2,47) Type 'number' could not be converted into 'string'

Notice how 1 doesn’t have the red underline, but 2 does! This doesn’t happen with a normal string.format call.

When autofill is not going to change any code and the enter button is pressed, it should skip to the next line straight away instead of closing the autofill box then having to press enter again to skip to the next line. Current behavior makes it so I have to press enter twice when the code I’ve typed is what I already want and autofill does nothing when I press enter the first time

6 Likes

Ah… well that seems to remove the use case for me then, because I can already control+F12 to find the definition of a function if I am using it, whereas I was using Alt+F to find the definition of obscure functions without having to do a general search through all scripts, such that the definition would be hidden among uses of the function in modules.

Mostly this was for finding the definition of OOP methods, since those are hidden behind layers that the binder alone can’t find through ctrl+F12, but also it can’t be found in types because type safety and OOP currently don’t go too well together.

1 Like

A couple things I’ve noticed while using the beta:

  • The else keyword isn’t registered in autocomplete correctly. Typing el and hitting enter tries autocompleting to the deprecated elapsedTime function.
    EDIT: Already a known issue.

  • Typing :Get in the context of an Instance and pressing enter defers to :GetActor instead of game:GetService or :GetChildren, which is what I’m used to.

    • The sorting of API members should prioritize inheritance (i.e. ServiceProvider:GetService is closer to DataModel than Instance:GetActor)
    • Perhaps some manual sorting factor should be hacked in to make sure GetChildren has precedence over GetActor.
      • Perhaps GetActor should only show up in parallel contexts, or it could just be deprecated entirely since we can just use FindFirstAncestorOfClass("Actor")?
  • The manually defined auto-complete constraints no longer seem to be taken into account:

    • BrickColor.new doesn’t respect BrickColor:any when constructing with a string.
    • Instance.new doesn’t respect Instance:isScriptCreatable
    • GetService and FindService don’t respect Instance:isService:0
    • FindFirst{X}OfClass doesn’t respect Instance:isScriptCreatable:0
    • FindFirst{X}WhichIsA doesn’t respect Instance:Any:0
  • Functions that are marked as deprecated in the ReflectionMetadata are not crossed out in the auto-complete options, though they are moved to the bottom of the list.

  • Callbacks are not acknowledged in auto-complete at all, deprecated or not.
    EDIT: They are acknowledged but use : instead of . for indexing, which is incorrect syntax.


Otherwise everything looks really good!
I’m loving it so far :slight_smile:!

15 Likes

Sublime Text solves this by giving more weight to results chosen previously.

3 Likes

Well, they are technically acknowledged, it’s just that they only show up when using : symbol which is not how callbacks are used so it’s still a bug nonetheless:
image

1 Like

I still don’t think GetActor should be taking precedence over more foundational methods like GetChildren.

Perhaps weighted importance could start with values that reflect the importance of the foundational members, then it could adapt overtime to how frequently the developer uses each? That or it could just be static and unchanging.

4 Likes

I’m exited for this update! It will make scripting easier so you don’t always have to hold down that backspace button! ( I’m talking to you if’s )

1 Like

I always get this error as return type after my functions and it is the reason why the function never appears at autocompletion.

image (the error code changes)

I didn’t use any type annotations:

function module:Create(pointsTemplate, duration, ...)

When I specify a return type, the error no longer appears and the function gets autocompleted.

When typing require and using auto-complete it doesn’t give me parentheses

3 Likes