AndreasMatthias / Luals2dox

Doxygen filter for Lua files.
GNU General Public License v3.0
2 stars 1 forks source link

Unable to generate example documentation #2

Open elegantiron opened 1 week ago

elegantiron commented 1 week ago

Steps to reproduce:

  1. Clone repository
  2. Run cd Luals2dox/example; make

Results: Luals2dox throws an error in the doxygen output (note that I have sanitized my home directory):

Preprocessing ~/Luals2dox/example/animal.lua...
/usr/bin/lua5.4: /usr/local/share/lua/5.4/luals2dox/core.lua:296: attempt to index a nil value (local 'url')
stack traceback:
        /usr/local/share/lua/5.4/luals2dox/core.lua:296: in function 'luals2dox.core.urldecode'
        /usr/local/share/lua/5.4/luals2dox/core.lua:362: in function 'luals2dox.core.is_current_lua_file'
        /usr/local/share/lua/5.4/luals2dox/core.lua:379: in function 'luals2dox.core.render_section_type'
        /usr/local/share/lua/5.4/luals2dox/core.lua:350: in function 'luals2dox.core.render_section'
        /usr/local/share/lua/5.4/luals2dox/core.lua:338: in function 'luals2dox.core.render_file'
        ...cal/lib/luarocks/rocks-5.4/luals2dox/0.3-2/bin/luals2dox:25: in main chunk
        [C]: in ?

When I run luals2dox -l I get the following

Binary:              lua-language-server
Working directory:   ~/Luals2dox/example
JSON file:           ~/Luals2dox/example/doc.json
Usage: luals2dox [-h] [-a] [-l]
       [--lua-language-server <lua_language_server>] [<file.lua>]

Error: Section 'luals.config' missing in JSON file.
AndreasMatthias commented 5 days ago

Please update lua-language-server.

Recent versions of lua-language-server add a section luals.config in doc.lua. This feature was added in version 3.8.0.

elegantiron commented 5 days ago

Thank you for the response. I've compiled the language server from the repository, and am now getting the following error

Preprocessing ~/Luals2dox/example/tabbycat.lua...
/usr/bin/lua5.3: /usr/local/share/lua/5.3/luals2dox/core.lua:296: attempt to index a nil value (local 'url')
stack traceback:
        /usr/local/share/lua/5.3/luals2dox/core.lua:296: in function 'luals2dox.urldecode'
        /usr/local/share/lua/5.3/luals2dox/core.lua:362: in function 'luals2dox.is_current_lua_file'
        /usr/local/share/lua/5.3/luals2dox/core.lua:379: in function 'luals2dox.render_section_type'
        /usr/local/share/lua/5.3/luals2dox/core.lua:350: in function 'luals2dox.render_section'
        /usr/local/share/lua/5.3/luals2dox/core.lua:338: in function 'luals2dox.render_file'
        ...cal/lib/luarocks/rocks-5.3/luals2dox/0.3-2/bin/luals2dox:25: in main chunk
        [C]: in ?

I get this error on all the files, not just tabbycat.lua.

~/Luals2dox/example$ lua-language-server --version
3.13.2

Luals2dox still complains about doc.json

Binary:              lua-language-server
Working directory:   ~/Luals2dox/example
JSON file:           ~/Luals2dox/example/doc.json
Usage: luals2dox [-h] [-a] [-l]
       [--lua-language-server <lua_language_server>] [<file.lua>]

Error: Section 'luals.config' missing in JSON file.
elegantiron commented 5 days ago

I pulled and compiled lua-language-server 3.8.0 and luals2dox works with that. It would seem that LuaLS changed they way they generate doc.json, and that is causing issues with luals2dox.

I don't feel qualified to determine whether this is a bug with luals2dox or LuaLS itself. Please decide and close this issue as appropriate.

AndreasMatthias commented 4 days ago

Thank you for the report.

I did a git bisect of lua-language-server and version 3.10.5 is the last commit that's working fine. The next commit did a bigger refactoring of the code and unfortunately lost some features that luals2dox relies on. I will file a bug report.

AndreasMatthias commented 4 days ago

Bug report: LuaLS/lua-language-server#2963