New Script Editor Hover Tips and User-Defined Function Documentation

Support for comments like params and other useful features that would be really useful for documentation codes

rn I’m working in a team project of 5 people, everyone knows how to script, but documenting each function gets messy

It’s been previous suggested to adopt the Moonwave standard, which is widely used in the Roblox open-source space, in community tooling like Luau LSP and many open-source libraries/packages for Roblox. Moonwave-style annotations would provide a clear standard for better expressing User-Defined Function Documentation, while integrating with what is already widely used. This would make it a good direction to go when looking for ways to improve or expand upon this feature.

Luau’s type system is not and won’t ever be smart enough to know what will be in a table at runtime unless it is typed or is defined with values.

After adding a module named “ModuleScript” inside the library handler

That script returns an empty table anyway - the function in there is local.

Adding a typeof() does not work

name is not defined here as it is outside of the scope of the function (typechecker can only access script-scoped variables), and, along with the first point, the typechecker is unable to get an arbitrary index of a table.

Having types with this method of having a library wrapper is not possible.
You could simply return a table of required modules, which would provide full autocomplete and typechecking:

-- Libraries ModuleScript:
local ExampleModule = require(script.ExampleModule)
local AnotherModule = require(script.AnotherModule)
local Modules = {
	ExampleModule = ExampleModule,
	AnotherModule = AnotherModule	
}

-- Script:

local Libraries = require(path.to.Libraries)
Libraries.ExampleModule.test()

This would provide typechecking:
image

Overall however, I don’t think a library wrapper is a good idea, simply because of the extra effort needed to add each module after it is added and, for what I can think of, the lack of a reason to have one.

Yeah, in the end I went with manually reffering to each available module :grin: