feat(visitors): add capi_class dependencies
ci/woodpecker/pr/docker-build Pipeline was successful Details
ci/woodpecker/pr/lint Pipeline was successful Details
ci/woodpecker/pr/test Pipeline was successful Details
ci/woodpecker/pr/build-and-run Pipeline failed Details

This commit is contained in:
Aire-One 2023-10-08 16:48:46 +02:00
parent a2d172d31d
commit 086ab2a474
1 changed files with 18 additions and 1 deletions

View File

@ -4,6 +4,23 @@ local utils <const> = require("awesomewmdtl.utils")
local spread = utils.spread
-- Very hacky way to get the module path of a capi class
-- We shouldn't rely on partial record for Node
local capi_class <const>: { string : Node } = {
Client = {
name = "Client",
module_path = "awful.client",
},
Screen = {
name = "Screen",
module_path = "awful.screen",
},
Tag = {
name = "Tag",
module_path = "awful.tag",
},
}
local function get_all_types_in_node(node: Node): { string }
local parameters_types = {}
if node.parameters then
@ -57,7 +74,7 @@ function Module_Dependencies.visit(node: Node, mod: Node, d: Dag)
goto continue
end
local dependency = d.modules[type_name] or d.modules[utils.lowercase(type_name)]
local dependency = d.modules[type_name] or d.modules[utils.lowercase(type_name)] or capi_class[type_name]
if dependency then
if dependency.name ~= mod.name then
mod.dependencies[dependency.name] = dependency.module_path