Autocomplete Documentation Code Samples and UX Overhaul

i promise you that there’s no reason your script should be that big if your code is written well. try seeing if the bug persists with the same table/data in a smaller script.

1 Like

That is not an excuse for it to not get fixed. (I said the bug happens mainly in large scripts, which states that does not happen in short scripts).

  • First of all, there is no reason for it to stop no matter how long the script is. I know if you end up with 10k lines it will probably start lagging because it has to highlight and find a lot of things for auto-completion, but 2k should be fine.

  • Second, the 2k lines is a Module full of utilities functions that I can use in my games and is that long. I divide the code using comment lines to state when something new has started. That’s how I do it and it will remain like that. Having a bunch of modules to separate unrelated tasks with just two functions or other things doesn’t makes sense to me. It probably does to you, but not me. I just do it if is really necessary and the data stored in the script is very different and large.

  • Finally, how long you write your code should not affect how auto-completion behaves.

4 Likes

or just use VS code. Builtin studio code editor is kinda bad ngl

3 Likes

I love this! Absolutely awesome!

I have one complaint though. The example given follows bad practice by directly picking the player from the workspace by name in the way that it does. Unfortunately it’s easier said than done to avoid this (and still keep it simple) and it’s debatable whether or not that is necessary, but, I think it’s good to note that if these code examples are using bad practice (and don’t point it out), it could definitely end up encouraging bad habits (this is also a problem I personally experienced for quite a while having mostly learned from free models initially haha, it could be much more helpful to have a comment or a note to say that something might be a bad way to approach a problem)

In this particular example, I think a better option could be to go psuedo-code style and replace workspace.Player with character, but, this has it’s own problems (notably, it isn’t a working example!). I think an even better approach would just be to try and break down the “proper” way to find a character by name (even though it is more complicated).

But, it’s a hard to solve issue with a not clear answer as to what is the best route to take, I don’t discredit the example for that, I just think it’s good to point it out as a potential issue.

For example, here’s personally how I might rewrite this to try and address it while still trying to keep it simple. Comments could also be a good way to help introduce new devs to other concepts at a slower pace than they might encounter them otherwise.

local function onRunning(speed)
	if speed > 0 then
		print("Player is running at speed", speed)
	else
		print("Player has stopped running")
	end
end

workspace.Player.Humanoid.Running:Connect(onRunning)
-- Note: 'workspace.PlayerName' isn't the best way to find a player's character
-- 'Player' instances you can find inside the 'Players' list have a 'Character' property you can use too
8 Likes

Great update, Roblox. Scripting will be much easier now. We appreciate the time and energy you guys put into making our developer lives better.
:wink:

1 Like

Please file issues like this as separate bugs with snippets of source code so that we can reproduce.

2 Likes

This sounds exactly like the Grepper chrome addon. I suggest that you check it out and for the engineers, that you take notes from how it works and implement something similar.
https://www.codegrepper.com

2 Likes

This is an absolute outstanding update, I always check DevHub for code samples, now this makes it x5 faster to make something

2 Likes

This is a terrible suggestion, in VSC you don’t have the Roblox built-in modules, and therefore you have to type it all yourself, and copy paste them, thats gonna be soo terrible, not gonna lie

1 Like

Great update, will help quite a bit when unsure which API to use.

but… multiple cursors when :eyes:

6 Likes

Sorry, was this a bug? I just found it rather cumbersome to read - didn’t know it was a bug, I was just using it as an example.

How do you turn off the code samples window if you don’t want it?

Umm yes you can. I use vs code on a daily basis and i can just insert the modules into studio(without copying and pasting it) and use the module normally

Could you please send me your theme values?

You should modularize your code. You don’t really want scripts over 1000 lines

whats even better is that you can already insert them by writing it in vs code.

image

not sure if this is a feature or a bug? why can we see only 1 suggestion at a time now? this is supposed to list variable 1 and 2 with both being visible simultaneously? please dont tell me this is a feature if it is where can i disable it

Absolutely wonderful update! I do have a question though, would we be able to utilize this with modules? Would it be possible for us to make modules that have descriptions and example codes? If not, is this planned for the future or not? Regardless, amazing update. I’m sure this will help a lot of people.

image

this is also supposed to list findfirstancestor/childofclass, with them all(or atleast more than 1) being visible at once in the list not just 1 at a time …what

Ooooo, this sounds like a really good quality of life change for programmers. :+1:

yes

Personally, I think it looks fine for now.