Script Editor: Luau-Powered Autocomplete & Language Features Beta

We are going to fix this next week.

2 Likes

Having the method name, argument name and type all be different colors in this pop up would make it quicker and easier to read at a glance

If an argument can accept a function value, autofill should not put the brackets () at the end. It’s more common for people to want to use the function as the value rather than whatever is returned from the function

What is this huge string of complete nonsense and why does it show up when I am editing a table? When typing on the second line of a table, it completely blocks the first line and makes it impossible to focus on it

4 Likes

I like it, but please, make it so it works when something is gotten from a WaitForChild, or FindFirstChild, here is a button I get with waitforchild, autocomplete where???

2 Likes

Yeah, this has always been annoying.

Thats also a thing, we should get GetService as the first thing when typing game:G or game:g.

With the release of Studio 491 we have included a few minor improvements.

else and elseif keywords are now suggested:
image
We are aware of the issue where ElapsedTime is still suggested when else is typed in full :roll_eyes:

Uppercase Workspace is suggested instead of the deprecated version:
image

Fixed missing members of StudioStyleGuideColor, StudioStyleGuideModifier, PermissionLevelShown, HoverAnimateSpeed, ListDisplayMode, OutputLayoutMode, LanguagePreference, ServerAudioBehavior, AutoIndentRule and DraftStatusCode enumerations:

9 Likes

When using this code

local module = {}

type obj = {
Test: () -> ()
}

function module.new():obj
    local testObj = {}

    function testObj:Test()

    end

    return testObj
end

return module

I always get this warning: This function does not take self. Did you mean to use a dot instead of a colon?
image

--!strict
local module = require(script.Parent.Module)
local obj = module.new()

obj:Test()

To fix it, you have to do this which is pretty annoying:

type obj = {
Test: (obj) -> ()
}

Then users might get confused about the additional parameter and you have these cycle references.

image

1 Like

Autocomplete uses the script editor font, and the UI resizes accordingly. Does reducing the Script Editor font size resolve this problem for you, or did you mean you want the ability to size Autocomplete text differently than Script Editor text?

1 Like

i like to see more features added to luau!

Thanks for improving a bit in Studio 491.

I just noticed now that when doing Instance.new() or Instance:IsA() it doesn’t show the instance options until you put the quotations.

Instance.new() --usually I can see the options by now

---------

Instance.new("") --quotes required to see the options

Also when doing something like

Instance[property] = [thing]

I would type out the entire thing that I want such as

Instance.Parent = plr --autocomplete is still suggesting, so I have to press enter twice to move on

This is a bit more of my feedback, hopefully the team can improve more on this.

2 Likes

When I use :IsA, there is no auto fill, and I use isa a lot.

1 Like

Could table keys be shown in different methods on the same table?

1 Like

Do you have an example where it fails? IsA() appears to be working as far as I can tell.

1 Like

It seems to be working now, which is strange. I had this problem just yesterday. I will follow up if I can reproduce the issue again.

Is this fix still being worked on? One week later, and while an update has been released, still auto-completing with ElapsedTime.

Cool! However, this still occurs.

For me I still get establishedtime when typing el

1 Like

That is presumably because Luau cannot infer that PlayButton is infact a button, so you can do script.Parent:WaitForChild("PlayButton") :: GuiButton, but I’d argue putting scripts inside of GuiObjects is a questionable practice, but I digress.

1 Like

Adding on top of this, I found out that some properties of CatalogSearchParams are declared incorrectly:
CatalogSearchParams.BundleTypes declared as string, expected {Enum.BundleType}
CatalogSearchParams.AssetTypes declared as string, expected {Enum.AssetType}
CatalogSearchParams.IncludeOffSale declared as string, expected boolean

image

1 Like

A new Studio update 492 has been released and with that come additional Autocomplete improvements.

Callbacks are now suggested using correct index syntax:


Thank you @BenMactavsin, @JoolCaat

Keywords that are values (true/false/nil) or are used to introduce a value (function) are now assigned a type and prioritized in type-correct contexts:


Thank you @0_salcret

Function type argument names are displayed in function signature help (when available):

Autocomplete will now try to suggest type annotations for function arguments:


And for locals:
E36vEBrLUj
@sjr04, @wynnrar this might help your event listeners until we get automatic inference.

WaitForChild lookups are now supported when we know the type:


In this example, AssignBlock is a RemoteEvent so you get the fields you expect.
Thank you @PoweredToFour

Luau learned to handle require through FindFirstChild and WaitForChild.
When lookup can be resolved, Autocomplete will provide module type data:


Thank you @paap15, @clayman100man

task.spawn and task.defer definitions were fixed:
image
Thank you @PysephDEV

When a function is auto-completed into an argument that accepts a function, () are not added:
tfq4ZG6qCb
Thank you @gillern

As always, we will continue adding fixes and improvements in the following weeks!

19 Likes