New Script Editor Hover Tips and User-Defined Function Documentation

Thank you for this!

This is a game changer for documenting our own work! (either for ourselves and for other people to use)

I agree with others regarding the addition of formatting, it would definitely be helpful!

If we can’t have formatting, it would be helpful to have @param and @return (and perhaps even @deprecated) tags.
It would allow developers to explain each parameter in detail, and explain what the method/function returns, and also if we can have the function crossed when it is marked as @deprecated. All these features stated above would definitely level up documentation on the platform.

Here’s an example (from Java):


43 Likes

With all these tips and reminders, developers will definitly reduce errors and iterations, means faster error detection. It would be interesting to see how much time is saved with updates like these and how many errors are caught earlier.

6 Likes

This has been needed for a looooong time!

Now we don’t have to go into our modules just to remember how to use them.

Can you add link support to these? (at least for links to the DevForum)

8 Likes

Cool stuff, and some cool info here: you can use <code> & </code> in your comments. Can’t find anything else, but it makes it read a little nicer.

With this, are we hoping to see something akin to JSDoc in the future? Such as variable descriptions, author tags and whatnot?

Code_2024-10-31_17-03-07

19 Likes

Open Documentation button is very useful, saves some time when needing to look up functions information.

7 Likes

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.

15 Likes

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.

19 Likes

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?
}
17 Likes

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.

5 Likes

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.

49 Likes

Types are still not highlighted differently from variable names!

17 Likes

I have long awaited user-defined function documentation. Finally, it’s here! This will make workflow much easier and quicker.

6 Likes

+1 Still waiting for this. Makes code look like soup right now.

9 Likes

“User-Defined Function Documentation”, Alright, y’all cooked with this one :fire:

5 Likes

User-defined function documentation? Amazing!

6 Likes

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!
Capture

16 Likes

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.

16 Likes

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?

7 Likes

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

image

image

12 Likes

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

6 Likes