New Script Editor Hover Tips and User-Defined Function Documentation

Indeed, that’s what I was saying, I completely agree with you!

2 Likes

Dont have access to bug reports, but __call metamethods don’t show function type tips and docs

local mt = {}

--[[
    test
--]]
function mt.__call(self: any, meow: "mrrp")

end

local tbl = setmetatable({}, mt)
-- doesnt show the ui that shows the function args, and the functions doc comment
tbl()

Theres a function attribute for marking functions as depreciated, its just not implemented yet.

http://rfcs.luau.org/syntax-attribute-functions-deprecated.html

This may be too petty of an ask to even be considered, but… Can the user-defined function documentation be made to ignore the leading double-hypens that are, by some people’s preference (including mine), included at the end of a multi-line comment?

For example, this…

--[[
  Does all the things
--]]
function foo()
end

…produces this:
image

I’ve made multi-line comments this way forever and it kind of drives me crazy.

1 Like

I like how my functions show their descriptions and info about their parameters (which I made a habit of writing long before this update), but there’s one problem with it…

The tooltip includes line breaks, which are okay for separating the first line (which lists the function’s name and parameters, which is redundant, I know) from its description, but this also includes other line breaks, but I only add those to keep the full comment on-screen without having to scroll sideways.

This is what the tooltip looks like now; Note the random line break after “If” on its third line…


Obviously, that’s just the break in the comment, but again, if I remove that, the original comment goes off the right side, adding the scrollbar at the bottom of the script editor, which I don’t like, and try to avoid.

I wouldn’t know how this could be “fixed” without messing up other programmers’ comments that require intentional single line breaks like this, but it’ll be disappointing if the only workaround is to make my comments super long, or just accept the awkward line spacing in the pop-up.

Are these tips going to work for dynamic loading of modules, too?

An example would be creating one’s own library handler, for example.

Example

Library simple code:

local Modules = {}
for _, module in pairs(script:GetChildren()) do
	if not module:IsA("ModuleScript") then continue end
	Modules[module.Name] = require(Modules)
end

-- Get module by name
local function GetModule(self: any, name: string)
	return Modules[name]
end return {
	GetModule = GetModule
}

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

local module = {}

-- Can you see this?
local function thisIsTest(test: number)
	
end

return module

image

Adding a typeof() does not work (which is kind of expected I would say). It would be cool if there was a way to do this though.