Add value from GetPropertyChangedSignal to autofill

Currently when you use a property or child in a piece of code then go to type that same value or property, autofill will recognize it and make it an option in the autofill menu.

It would be useful if it did the same thing with values for GetPropertyChangedSignal. For example, if I do Frame.UIListLayout.Name, autofill will remember .Name is a property of the UIListLayout. When I do Frame.UIListLayout:GetPropertyChangedSignal("AbsoluteContentSize"), it does not remember or recognize AbsoluteContentSize as being a property.

3 Likes

Unless I’m misinterpreting your feature request, it wouldn’t seem correct for the intelliSense to recognize AbsoluteContentSize as a property. In your code example self.Frame.UIListLayout is not seen as an Instance, but rather as a table.

In order for this to work, the intelliSense would have to assume that any method named GetPropertyChangedSignal is referring to a property. However, in situations that it’s not, this would cause incorrect autocorrect.

1 Like

The issue is that you’ve got no type information for intellisense to know what self is and can it only infer from your previous inputs in that method’s scope.

To get proper intellisense you’d have to cast a type for your table like so:

type Module = {
	UIListLayout: UIListLayout,
	DoThing: (self: Module) -> ()
}

local Module = {} :: Module

Module.UIListLayout = Instance.new("UIListLayout")

function Module:DoThing()
	self.UIListLayout:GetPropertyChangedSignal("AbsoluteContentSize")
end
1 Like

Your point is true, but I also think it’s safe to assume that any method even in a table called GetPropertyChangedSignal is referring to a property of that table/instance

I don’t think it’s a good idea to hardcode GetPropertyChangedSignal as an event that belongs to instances which has a string argument, not because thinking indexing something with GetPropertyChangedSignal is an instance is bad (though, I could use that argument as well), but that hardcoding is horrible. If you want to use Instance APIs on a custom type, can’t you use union intersection types (Type checking - Luau)?