ldoc
ldoc copied to clipboard
Getting "<luafile>: contains no items"
I am trying to generate a documentation for https://github.com/FAForever/fa/tree/develop/lua
To do so I am running from within E:\git\faforever\fa
ldoc lua -d E:\git\faforever\fa-lua-doc\
but all I get is:
e:\git\faforever\fa\lua\aeon_naval_weapons.lua:1: contains no items
output written to e:\git\faforever\fa-lua-doc\aeon
However, I can generate documentation for other sub-directories without problems e.g.
ldoc lua\AI -d E:\git\faforever\fa-lua-doc\AI
works without troubles.
I'd like to generate a documentation for the whole lua\ directory. How can I make ldoc simply run over all files and ignore whether there are items or not? Is that possible?
Running it for the entire directory ldoc lua -d E:\git\faforever\fa-lua-doc\ will parse only through the first directory but then stop without a warning or anything. These are the last few lines before ldoc terminates:
...
e:\git\faforever\fa\lua\ai\platoontemplates\seaplatoontemplatessorian.lua:42: empty file
e:\git\faforever\fa\lua\ai\platoontemplates\structureplatoontemplatessorian.lua:105: empty file
e:\git\faforever\fa\lua\ai\aiarchetype-managerloader.lua:202: empty file
e:\git\faforever\fa\lua\ai\aibuildstructures.lua:658: empty file
e:\git\faforever\fa\lua\ai\sorianlang.lua:318: empty file
...
e:\git\faforever\fa\lua\aibrain.lua:2301: definition cannot be parsed - not 'name=value' or 'return value'
e:\git\faforever\fa\lua\aibrain.lua:3475: definition cannot be parsed - not 'name=value' or 'return value'
e:\git\faforever\fa\lua\aibrain.lua:852: VOSounds: 'VOSounds' had no return?
Stefan@STEFAN-PC E:\git\faforever
No message or reason why it terminated without producing anything :/
Oh, just terminating is not good! I see you have the docs in another repo, but
git clone https://github.com/FAForever/fa-lua-doc
Fails to pull? Is it public? I don't see it in your repo list.
Basically need to see the config.ld and work from there...
(Pretty cool project, BTW)
Hi! The repository would be https://github.com/FAForever/fa.git, but I've already fixed it.
It turns out that the last line where VOSounds was declared looked like this:
--------------------------------------------------------------------------
---- ---------- System for playing VOs to the Player --------
--------------------------------------------------------------------------
VOSounds = {
}
and LDoc simply didn't like that - so it stopped there. The thing is just that there was not explicit error message like, "Error in line 852; Please fix this" or something which is why I didn't think it could be just a malformed comment or whatever made LDoc stumble here.
I don't know if it's possible but maybe prompting an error message would help in such cases.
BR;
We must definitely have an error there! Thanks, I think you've found a bug.
You're welcome! Thanks for keeping LDoc up! :+1:
@lionkor You mentioned you had or could work up a fix for this issue. Is that still something you can submit?
I can take a look, yeah, but I dont have a fix ready yet
I could not reproduce it with the fa code above, but I was able to reproduce it with this:
--- my function
-- takes nothing and returns nothing
-- @return nothing
function DoNothing()
end
--
Thing = {
}
the output is
reading configuration from /home/lion/src/xyz/config.ld
/home/lion/src/xyz/main.lua:1: contains no items
format: using built-in markdown
output written to /home/lion/src/xyz/public