Troubleshooring¶
Autodoc can’t fund a module or object¶
Set
lua_ls_verbose = Trueinconf.pyand run build with-E(make html O="-E").Search build log for record
Lua analysis finished. Found objects:and see if object that can’t be found appears in the object tree.If it’s there, check spelling and full path of the object. Error message will contain all candidate paths that Sphinx-LuaLs tried when resolving it.
If it’s not there, check your documentation markup, EmmyLua/LuaLs settings, and project paths and directories:
Check that
lua_ls_project_rootandlua_ls_project_directoriespoint to the right places.You can see how Sphinx-LuaLs launched language server by grepping build log for message
running lua-language-server with args.Make sure that you have an explicit return at the end of a module.
If your module only sets global variables, return an empty table from it:
-- mod.lua --- Module documentation. return {}
Alternatively, if your module exports a global variable with the same name, make sure to set its doctype:
-- mod.lua --- Module documentation. --- --- @doctype module mod = { -- Module contents. }
Make sure that your project directories are listed in
.emmyrc.jsonunderworkspace.workspaceRootsand notworkspace.library.
Check that
lua_ls_project_rootandlua_ls_project_directoriespoint to the right places.You can see how Sphinx-LuaLs launched language server by grepping build log for message
running lua-language-server with args.Make sure that you’ve created a class named after your module, and set its doctype:
-- mod.lua --- Module documentation. --- --- !doctype module --- @class mod