feat(Module_Doc): fixup to add property signals
ci/woodpecker/pr/build Pipeline was successful Details
ci/woodpecker/pr/docker-build Pipeline was successful Details
ci/woodpecker/pr/lint Pipeline was successful Details

This is a naive approach to automatically add all the `"property::"`
signals. A better way to do that would be to look for this information
in the documentation with the scrapper. It would be, however, less
efficient, and requires quite a few refactors of the data structure.

So this current naive approach will be good enough for now.
This commit is contained in:
Aire-One 2023-01-08 17:56:51 +01:00
parent ed1763524f
commit 013bff1a31
1 changed files with 7 additions and 0 deletions

View File

@ -56,6 +56,12 @@ local function fixup_static_functions(self: Module_Doc)
end end
end end
local function fixup_properties_signals(self: Module_Doc)
for p in self.properties:iter() do
self.signals:append("property::" .. p.name)
end
end
local __Module_Doc: metatable<Module_Doc> = { local __Module_Doc: metatable<Module_Doc> = {
__call = function(_: Module_Doc): Module_Doc __call = function(_: Module_Doc): Module_Doc
return { return {
@ -71,6 +77,7 @@ local __Module_Doc: metatable<Module_Doc> = {
fixup_methods(self) fixup_methods(self)
fixup_properties(self) fixup_properties(self)
fixup_static_functions(self) fixup_static_functions(self)
fixup_properties_signals(self)
end, end,
populate_requires = function(self: Module_Doc) populate_requires = function(self: Module_Doc)
-- TODO : Move this to other Entities. Can be a little tricky because we populate a map -- TODO : Move this to other Entities. Can be a little tricky because we populate a map