Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inlay hints for parameter types bug related to self #702

Closed
jiwonz opened this issue Jul 18, 2024 · 0 comments
Closed

Inlay hints for parameter types bug related to self #702

jiwonz opened this issue Jul 18, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@jiwonz
Copy link

jiwonz commented Jul 18, 2024

The inlay hint for the self parameter of function Class.foo displays the type of the next argument. This occurs only when the "Inlay Hint: Parameter Types" option is turned on in the vscode luau-lsp settings and the name of the first argument is self.

If you enter it manually or check its type, it will appear correctly. So it looks like this bug is only related to inlay hints.

luau-lsp version: v1.32.0

Reproduce

type Class = {
	foo: (self: Class, bar: string) -> ()
}
local Class = {} :: Class

function Class.foo(self, bar) -- expected inlay hints: `function Class.foo(self: Class, bar: string)` actual result: `function Class.foo(self: string, bar)`
	-- do something
end

Media

The problem

Screenshot_20240718-161023

When the parameter name is not self

Screenshot_20240718-161100

The actual type of wrong displayed inlay hint parameter

Screenshot_20240718-161135

@JohnnyMorganz JohnnyMorganz added the bug Something isn't working label Jul 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants