There’s no interface or request/response model change to this API, but you will get user-defined documentation content as part of the Response (if it exists).
It’s on the same property as our built-in documentation (ie. Response.items[n].documentation)
you are correct, codegen takes up a bit more memory but the current limit is 64mb; it’s more about scripts taking slightly longer to load (due to compilation) and the average function takes up to 5kb unless you’re doing a lot of math or accessing the datamodel
Both of those types of comments, --- and --[=[]=] are used for Moonwave doc comments. The majority of open-source libraries in the Roblox Open Source Community use Moonwave for their documentation. So they are used quite often.
local ObjectObj = {}
ObjectObj.__index = ObjectObj
--destroys it, if the cosmic bit flip occurs
function ObjectObj:Destroy():nil
return nil
end
type ObjectType = {
Destroy: typeof(ObjectObj.Destroy)
}
function createObject():ObjectType
return setmetatable({}, ObjectObj)
end
local obj = createObject()
obj:Destroy()
Luau is derived from Lua which is prototype-based. Classes are a huge feature, and are fundamentally different to the principles of the language. Likely, asking on an unrelated announcement, not even on the Luau GitHub, won’t sway any decisions.
Metatables are the closest we’ll get to “proper” OOP (I don’t think you need some special declaration to call something object-oriented), and are also how Roblox’s own classes are represented for Luau code.
local t = {}
function t.new()
return setmetatable({
value = 1
}, t)
end
type t = typeof(t.new())
function t.print(self: t, n: number)
pairs("something")
end
t: --> no print??
at the end of this snippet, you can see it doesn’t show the print method, could this specific case be added considering OOP is used alot in luau? we need a way to access the object entries within it’s methods without having to type the whole thing out.
the approach I showed in the snippet above is how I usually allow autocomplete to work, without it the autocomplete doesn’t work within the object methods.
I was about to make this post myself! I personally spend a lot of my time using Java and JavaDocs and these tags are extremely useful as a developer, especially when reading third-party packages (in roblox’s case modules). After this update I’ve gone through some of my own code and started adding function documentation and I’ve found it a bit difficult to explain the purpose of certain parameters without having the documentation look weird.
If we could add comments like these per-variable this would be even more of a game-changer!
Like others have suggested, if we could go as far as LuaDocs like @permanent_fixture had mentioned, the possibilities for user-made documentations would be extreme.
Although there are many things which I want in the future, this itself is already a huge update that I’m very grateful for. Much apprecated!
i was wondering why the tooltip looked a little different, the users-defined function documentation is a absolute game-changer for me! thanks for the great update roblox