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

Section luals.config missing in doc.json #2963

Open
AndreasMatthias opened this issue Nov 21, 2024 · 2 comments
Open

Section luals.config missing in doc.json #2963

AndreasMatthias opened this issue Nov 21, 2024 · 2 comments

Comments

@AndreasMatthias
Copy link
Contributor

File doc.json contained a section luals.config up to commit ba8f90e (3.10.5).
But after a major refactoring of the code in commit aeb9ccb, this section
doesn't exist any more.

I suppose that it was not intended to drop it. The original code came from this pull request #2562.

Can someone give me a hint on how to reimplement it? I'm a bit lost in the new code.

@tomlau10
Copy link
Contributor

The major refactoring was done in this PR #2821 by a contributor @skarph .
From the PR description, the refactor aims to expose a Lua.docScriptPath config for customizing the export logic. And if left empty then it will run the default script/cli/doc/export.lua export logic.

Seems that he incorrectly treated luals.config as a doc object type 😕

---@alias doctype
---| 'doc.alias'
---| 'doc.class'
---| 'doc.field'
---| 'doc.field.name'
---| 'doc.type.arg.name'
---| 'doc.type.function'
---| 'doc.type.table'
---| 'funcargs'
---| 'function'
---| 'function.return'
---| 'global.type'
---| 'global.variable'
---| 'local'
---| 'luals.config'

(all other types are the parser object type in luals AFAIK)


If I understand correctly, your original code #2562 actually adds luals.config as a doc entry in the results[] array, which is a hack anyway? Perhaps you can do the same in export.makeDocs in the current refactored version 🤔 ?

function export.makeDocs(globals, callback)
local docs = {}
for i, global in ipairs(globals) do
table.insert(docs, export.documentObject(global))
callback(i, #globals)
end
table.sort(docs, export.sortDoc)
return docs
end

=> add your entry into the docs[] array

@AndreasMatthias
Copy link
Contributor Author

Thanks for these explanations. I'll try to reimplement it.

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

No branches or pull requests

2 participants