Open Documentation button is very useful, saves some time when needing to look up functions information.
User-defined comments are displayed as raw text for now (with some small support for formatting tags). We may support special annotations in the future! LuaDoc-like annotations have been discussed internally in the past.
The community generally uses Moonwave
for annotations, so it might be good to support that over LuaDoc. It’s a bit more work but it would integrate with what people are already using more.
You gotta use a hacky work-around for this unfortunately.
type foo = {
Function: typeof(--[[documentation goes here]]
function() end)
}
this works but yeah this is really messy :
hopefully documenting types will be a thing in the future. I want to do either
--makes it string
type foo = (number) -> (string)
or
type foo = {
--documenting like this
bar: () -> () --... or like this?
}
This still needs some work. It seems to me that user-defined function types are not supported, and as mentioned in the post above, there is only a hacky way of doing it.
At present you should be able to use these HTML tags in the documentation tip:
<em>
for italics.
<strong>
for bold
<code>
for code
<sup>
forsuperscript
<br>
for line-breaks
<p>
for paragraphs.
I have long awaited user-defined function documentation. Finally, it’s here! This will make workflow much easier and quicker.
+1 Still waiting for this. Makes code look like soup right now.
“User-Defined Function Documentation”, Alright, y’all cooked with this one
User-defined function documentation? Amazing!
If you style block comments like I do you end up with an extra “--
” at the end of the user-documentation, it’d be nice if it wasn’t included!
This is a really cool feature, however standard practice in luau docs tooling has been to use ---
and --[=[]=]
for doc comments. Hope you guys change to use this instead of fragmenting the ecosystem when so much documented code has already been written with tools like moonwave.
I have been waiting for the user-defined function documentation for years at this point! This is going to make my modules so much easier to explain and use.
On another note, are we going to be able to include code examples and external links to documentation like the Roblox API functions have here?
currently throwing an attribute between the comment and a function on different lines doesn’t show the comment, other than that this is what i’ve wanted for damn near a whole year
Does anybody here know if comments are still included in the runtime scripts? As-in they will be included in the finalized code and/or still take up memory.
I’ve been wondering for a long time due to luau’s non-compiled nature
Probably true… but having the option should still be on the table - it’s common.
I’ve been trying to learn Lua/Studio scripting for the last year… and it’s not easy.
However… watching UE tutorials last week - it’s so much simpler.
If it wasn’t for the Roblox audience I want to reach - I would have switched already.
The graphics are way better - less revamps/changes - moderation isn’t an issue like on Roblox - people cheating doesn’t exist.
I like Roblox still… but trying to find the right material/tutor to learn is no easy task.
Find a script partner is even a worse attempt.
Luau is compiled to more efficient “bytecode” before being interpreted or sent to Clients. This involves stripping comments and most variable names, as well as optimizations. Also, did you know Native Codegen exists?
As someone who works both in Lua and UE Blueprints it is a lot easier to learn but the aim of Roblox and getting young developers to learn and utilise Roblox is so that there is more written programming languages programmer’s to prepare people for stuff like jobs in the real world.
Since you’re trying to learn lua I can give you some advise. I learnt both from watching videos on the diffrent functions within lua as well as reading though documentations and searching for solutions to issues using the DevForums. Over time you’ll watch yourself improve that way and something that is useful is to only learn what you truly want to make as that will also continue to motivate you to get what you want completed but also inspire you to go further while also learning the skills.
Yes, I know about native code, though I believe it was said it takes extra memory (or something along those lines). I often use it on server code.
Thanks for the response, I couldn’t think of anything to search that would give me any answers for this