Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support nested subparams #401

Open
DifferentialOrange opened this issue Aug 15, 2023 · 2 comments
Open

Support nested subparams #401

DifferentialOrange opened this issue Aug 15, 2023 · 2 comments

Comments

@DifferentialOrange
Copy link

DifferentialOrange commented Aug 15, 2023

ldoc has support of subparams (even though the feature is a bit hidden):

-- A function with subfield arguments.
-- @param s string
-- @param opts multibyte encoding options
-- @param opts.charset string
-- @param opts.strict bool
-- @param verbose bool

Since Lua does not have support of named params, it is not rare to have multiple level nested tables. Unfortunately, now ldoc doesn't have nested subparams support.

The following script

-- @table opts
--
-- @table opts.mytarg1
--  My table arg 1
--
-- @string opts.mytarg1.field1
--  My table arg 1 string field
--
-- @bool opts.mytarg1.field2
--  My table arg 1 bool field

is compiled to
image
even though it would be nice to see something like
image

Restricting max nesting depth with configuration may also be useful here.

@alerque
Copy link
Member

alerque commented Aug 16, 2023

This does seem like something we should surface. I don't have much dev time to contribute right now but I am keeping an eye on PRs and if anybody chips in to contribute this I think we can facilitate it getting included.

@Elv13
Copy link

Elv13 commented Mar 29, 2024

It can be done by making a custom LTP template, see https://awesomewm.org/apidoc/core_components/client.html#shape

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants