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

Unable to generate example documentation #2

Open
elegantiron opened this issue Nov 19, 2024 · 5 comments
Open

Unable to generate example documentation #2

elegantiron opened this issue Nov 19, 2024 · 5 comments

Comments

@elegantiron
Copy link

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Owner

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

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