-
-
Notifications
You must be signed in to change notification settings - Fork 331
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
LuaLS autodoc is including global table in output md/json files #2977
Comments
My workaround for this (cc @Luke100000 - #2954 (comment)) lua-language-server --configpath .luarc.doc.json --doc ../.. --doc_out_path _data // .luarc.doc.json
{
"$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json",
"runtime.version": "Lua 5.1",
"runtime.builtin": {
"basic": "disable",
"bit": "disable",
"bit32": "disable",
"builtin": "disable",
"coroutine": "disable",
"debug": "disable",
"ffi": "disable",
"io": "disable",
"jit": "disable",
"math": "disable",
"os": "disable",
"package": "disable",
"string": "disable",
"table": "disable",
"table.clear": "disable",
"table.new": "disable",
"utf8": "disable"
}
} Surprisingly simply adding: |
Thanks for the method, this is more efficient than I directly changed the doc.lua file in the lsp |
Turns my fix is not sufficient. I'm still getting methods like Adding these options to |
Sorry, I'm mistaken. The older version has this same problem. It just emits the builtins later in the file so I missed them. My mistake! At present I have no good solution for this because |
So for now just use a script to gen docs? Is it a sensible way to do it?
mv ./.luarc.json ./.luarc.temp.json
mv ./.luarc.docs.json ./.luarc.json
lua-language-server --doc . --doc_out_path .
mv "./.luarc.json" "./.luarc.docs.json"
mv "./.luarc.temp.json" "./.luarc.json"
Rename-Item -Path ".\.luarc.json" -NewName ".\.luarc.temp.json"
Rename-Item -Path ".\.luarc.docs.json" -NewName ".\.luarc.json"
& 'lua-language-server.exe' --doc . --doc_out_path .
Rename-Item -Path ".\.luarc.json" -NewName ".\.luarc.docs.json"
Rename-Item -Path ".\.luarc.temp.json" -NewName ".\.luarc.json" |
This is my plan too. I made an issue for this problem: #2997 |
I guess the two comments / workarounds below should be posted on this issue instead: |
Hello, my PR seems to be able to help you solve this problem, after testing, the luarc configuration file you provided can be read normally, and the lua module can also be filtered in the exported document. |
How are you using the lua-language-server?
Command Line
Which OS are you using?
Windows
What is the issue affecting?
Other
Expected Behaviour
I expect to have only annotations defined with the lua file/directory be generated as docs
Actual Behaviour
The whole _G table is being generated as docs
Reproduction steps
Create a file
test.lua
with the contents ofRun the command: ./lua-language-server.exe --doc "./test.lua" --doc_out_path .
Observe the output:
Additional Notes
I am using lua-language-server-3.13.2-win32-x64 that I downloaded on github from the releases file
Log File
file_c%3A_Users_test1_Desktop_lua-language-server-3.13.2-win32-x64_bin_test.lua.log
The text was updated successfully, but these errors were encountered: