diff --git a/src/awesomewm.d.tl/entity/Function_Info.tl b/src/awesomewm.d.tl/entity/Function_Info.tl index d8605ad..19799fd 100644 --- a/src/awesomewm.d.tl/entity/Function_Info.tl +++ b/src/awesomewm.d.tl/entity/Function_Info.tl @@ -22,6 +22,36 @@ local record Function_Info fixup: function(Function_Info) end +local function fixup_parameters(self: Function_Info) + for p in self.parameters:iter() do + p:fixup() + end +end + +local function fixup_return_types(self: Function_Info) + for r in self.return_types:iter() do + r:fixup() + end +end + +local function fixup_signal_type(self: Function_Info) + if List { + "connect_signal", + "weak_connect_signal", + "disconnect_signal", + "emit_signal", + "emit_signal_recursive", + }:contains(self.name) then + if self.parameters[1].name == "self" then + -- Instance level method + self.parameters[2].types[1].name = "Signal" + else + -- Static function + self.parameters[1].types[1].name = "Signal" + end + end +end + local __Function_Info: metatable = { __call = function( _self: Function_Info, @@ -34,12 +64,9 @@ local __Function_Info: metatable = { return_types = return_types or (List() as List), fixup = function(self: Function_Info) - for p in self.parameters:iter() do - p:fixup() - end - for r in self.return_types:iter() do - r:fixup() - end + fixup_parameters(self) + fixup_return_types(self) + fixup_signal_type(self) end, } end,