Functions with colons in type not autocompleting

Hey there!
I’m currently trying to make a custom type that contains functions, which are called with a colon. However they don’t autocomplete. They only autocomplete when called with a dot. Is there any way to get them to autocomplete only with a colon, or at least both of them?

For example, say I’ve got this type

type SomeType = {
	SomeFunction: (var: string) -> ()
}

And I make a new variable with that type & attempt to use the function with a colon

local someVar: SomeType = ...
someVar:SomeFu

The function does not autocomplete!
However if I were to change the colon to a dot, it all of a sudden autocompletes.

I’ve also noticed, that if I, for example, change the type to:

type SomeType = {
	SomeFunction: (self, var: string) -> ()
}

Then it does autocomplete on both variations, however the first argument is shown as _: *error-type*, presumably because “self” isn’t defined there.

So is there a way to make it autocomplete normally?

type SomeType = {
    SomeFunction: (self: SomeType, var: string) -> ()
}
1 Like

Oh, it was that simple. Thank you!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.