Skip to content

First argument does not get skipped in tooltip for method calls on functions returned by type functions #1250

@StevenDahFish

Description

@StevenDahFish

Reproduction Code

type function repro()
	return types.newfunction({ head = { types.any, types.number } }, { head = { types.boolean } })
end

local foo: { bar: repro<> } = {
	bar = function(self: any, n: number): boolean
		return true
	end
}

foo.bar(foo, 2)
foo:bar(2)

Using the luau-lsp extension, the tooltip doesn't skip the first argument when writing out methods defined by a type function.

Image

In comparison to Roblox Studio, which properly omits the first argument.

Image

Expected Behavior

(this is by removing the typing from foo)

Image

Note that the autocomplete does correctly only suggest that one argument is available while typing the method, as well as not having an "Argument count mismatch" error. It is only for the tooltip that doesn't skip the first argument properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions