Autocomplete Documentation Code Samples and UX Overhaul

Hey Developers,

Happy Friday! We’re excited to announce two major improvements to the current Script Editor Autocomplete feature: a full UX Overhaul and Documentation Code Samples!

Back in January, we released Luau-Powered Autocomplete & Language Features, which brought intelligent suggestions and documentation to the Script Editor. Since then, we’ve been listening to your feedback and refining the feature to best serve the community.

We’re thrilled about the results, and we think you will be too.

New Improvements

Code Samples

This is a feature we’ve been working on for quite some time, and after extensive collaboration with the Documentation team, we are proud to announce that Code Samples are now embedded inside 1000+ Autocomplete documentation entries!

Code Samples are displayed within the documentation window and can be hidden or displayed at will. An on-hover copy button in the lower right corner of the window allows for easy insertion of Samples into the Script Editor.

UX Overhaul

We worked closely with our designers on improving the Autocomplete and Documentation UX based on feedback from the community, and we think the results speak for themselves.

Before:

After:

Besides a general refinement of the features’ look and feel, we also made some specific enhancements:

Widget Draggability

  • The Autocomplete suggestion list, documentation widget, and the Signature Help widget can now be resized by dragging on the edges of the respective windows. Dragging a widget sets its new max size, which persists across sessions.

Type Info

  • Autocompletion type info has been moved from the suggestion list to the documentation widget, providing for greater readability and reduced visual noise.

Looking Forward

Now that we have a framework for displaying Code Samples in Autocomplete documentation, we’ve begun the task of increasing the number and quality of the samples we provide.

Over the next months, we’ll be working to identify the APIs that are most used by developers, so that we can prioritize adding Code Samples where they’re needed most. Meanwhile, we’ll refine the Code Samples we already provide, so that they can offer context on Roblox API calls as succinctly and cleanly as possible.

Big thanks to the following who contributed to making Code Samples and the UX overhaul possible: @yohooyohoo, @infomancer, @code4xp, @cozecant, @iriszh and @windy0724

Happy scripting!

315 Likes

This topic was automatically opened after 10 minutes.

This is an absolute amazing update, and I’m looking forward to seeing more things like this in the future! This will help scripters who are learning, and all scripters to make better scripts in faster time! Love to see it!

Could it be possible to have a button to see more examples, which community members and scripters could submit? So you can view example usage made by other creators, not just from roblox.

27 Likes

This is great, but is this bug ever gonna get fixed?

Its an incredibly annoying bug and would be great if it gets patched slight_smile:

15 Likes

Can we please have custom documentation & code samples, this will help developers remember what API does.

LSP plugin has the exact feature I’m talking about, it would be pretty great if this was studio

26 Likes

Thanks! Now I don’t have to search up for hours what one specific thing means. Does this work for literally every single instance?

8 Likes

Really good update. This will definitely improve coding and autocomplete in general.

From what I see, it got smaller. Not sure if it’s true or not because I haven’t checked personally yet, but I’d be glad if it did. The old one felt way too big and sometimes got in the way when I am trying to reference something that got hidden by the ui.

7 Likes

I am happy with the changes but why does auto complete doesn’t show up sometimes? It happens mainly in large scripts.

image

10 Likes

:open_mouth: epic! Been waiting for something this cool for a while!

7 Likes

Completely awesome! being able to see actual code examples is a huge bonus.
Are there any similar plans to “revamp” how Luau types are shown? Trying to figure out what’s wrong here is not fun… :sweat_smile:

7 Likes

would be really nice if clicking the “show code example” text showed the example as well

14 Likes

I love it! But can you pleaseee make the box less ugly? I personally hate how it looks right now

3 Likes

Great start, but I would love to see better ordering of API in the autocomplete menu based on type annotations and other contextual factors. For example, if I have the following code:

local tweenInfo: TweenInfo = ...

And I type a “T” on the right-hand side of the equals sign, the first suggestion listed in studio today is “true” followed by “TweenInfo” and then “tonumber”. Autocomplete should intelligently look and see “oh, this variable is a TweenInfo, let’s bump that up to the top”.

It’d also be nice to have a similar system for instances as well, and not just data types. For example, the following code:

local attachment: Attachment = In...

Should immediately suggest Instance.new("Attachment") as the first suggestion, but instead suggests “if”. And even after I type out Instance.new(), this is the autocomplete ordering…

image

I mean come on, really??? The type annotation clearly says “Attachment” doesn’t it??? Why is Humanoid the first suggestion???

This should also apply to functions as well, where functions with the same return type as the variable being assigned to are prioritized.

10 Likes

This is so amazing! This will save me a lot of time and will help many new developers. I really like this update.

2 Likes

This is cool, but it would be nice if autocomplete was a little smarter in its suggestions. What I mean by this is it sometimes just gives suggestions that make no sense. For example if you type in game:G you’ll probably get GetAttribute because it comes first alphabetically, but that is seldom used. It would be much nicer if it knew that game:G usually means game:GetService which is the second suggestion (at least for me). It would definitely improve workflow if it was able to analyze widely used code (kinda like copilot from github, but not that advanced) just to know what good suggestions would be. I’ve personally never used game:GetAttribute and I don’t know anyone else that has, GetService should definitely have priority over GetAttribute. There are some other places where this would also help, too, but that one is the biggest I know of.

7 Likes

I haven’t tested it yet, but does the UX redesign imply it’s less “intrusive”? When I’m going line by line in scripts and need to copy things from the line above to the line below, I can’t since UX overlays it, and hitting Escape doesn’t close it.

2 Likes

Oh this is so awesome, I can’t wait to get proper internet again to be able to practice with scripting, this auto fill option will be extremely helpful to learn how things would and can go.

Thanks so much for this, I look forward to try it out.

5 Likes

I noticed this earlier today. Amazing update! Thanks roblox team.

Will we be able to add our own code samples for this some time in the future? Kinda like how we can in vs code.

4 Likes

Great update!
Can’t wait for you guys to (hopefully) add the ability to add our own definitions, parameters and code examples for our functions/methods.

2 Likes

Could you please send me your theme values? Lol?

3 Likes