Skip to content

Section luals.config missing in doc.json #2963

New issue

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

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

Already on GitHub? # to your account

Closed
AndreasMatthias opened this issue Nov 21, 2024 · 2 comments · Fixed by #3072
Closed

Section luals.config missing in doc.json #2963

AndreasMatthias opened this issue Nov 21, 2024 · 2 comments · Fixed by #3072

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.

AndreasMatthias added a commit to AndreasMatthias/lua-language-server that referenced this issue Feb 12, 2025
Section luals.config was implemented in LuaLS#2562, but got lost
after a major refactoring in LuaLS#2821. This commit reimplements it.
See discussion LuaLS#2963.
AndreasMatthias added a commit to AndreasMatthias/lua-language-server that referenced this issue Feb 12, 2025
Section luals.config was implemented in LuaLS#2562, but got lost
after a major refactoring in LuaLS#2821. This commit reimplements it.
See discussion LuaLS#2963.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants