Open rhys-vdw opened 5 days ago
I have discovered that this error goes away if I provide --doc_out_path
! 🤦
I feel like the wiki would greatly benefit from an example!
I believe this is supposed to output to the log path if no --doc_out_path
is provided.
I believe this is supposed to output to the log path if no
--doc_out_path
is provided.
Yeah, it's hard to decypher. But it fails with the same error on both windows and WSL for me.
On WSL I built from master, on Windows I downloaded latest release exe.
I remembered there was a heavy refactor on the doc generation code, don't know if it has broken anything 🤔
related PR: https://github.com/LuaLS/lua-language-server/pull/2821, the outputDir
variable seems to be introduced in it
This would benefit greatly from a default output dir, or an error log that catches that the param was not added and logs an error and example use.
I mentioned this issue in my previous issue, and I need to provide two options:
https://github.com/LuaLS/lua-language-server/issues/2927
The reason for this error is because the directory address of the --doc_out_path
option is not provided in the options. However, depending on the wiki, when the option is empty, it will be exported to the log folder by default, but I don't see my exported documents in the log
folder. According to the error prompt, I finally found that the outputDir
variable is nil. This is inconsistent with what the documentation says is the default address of the log
directory.
In addition, due to this reason, the document export function of the luals plugin of vscode is disabled, and the error message displayed in the log file is shown in this issue. Because the value of the '--doc_out_path' option is missing, the 'outputDir' variable is nil.
I'm surprised that this file isn't using the type annotations that lua language server provides to alert the developer that the CLI arguments might be nil
and force them to handle it. This all seems possible!
I'm surprised that this file isn't using the type annotations that lua language server provides to alert the developer that the CLI arguments might be
nil
and force them to handle it. This all seems possible!我很惊讶这个文件没有使用 lua 语言服务器提供的类型注释来提醒开发人员 CLI 参数可能为nil
并强制他们处理它。这一切似乎都是可能的!
I looked at the source code of this file, and the error point was that the outputDir variable was concatenated with the string when the nil value was valued. I don't know when the default log folder path described in the documentation was given this parameter, perhaps the developers have their own considerations. Also, not only that, there are also a lot of type conversion functions in the doc export function that are not commented, but I saw the doc.lua file when I first read this project, so I had a hard time reading it, and I wanted to serialize the output content, and I ended up with a burst stack. Once again, my path to understanding has stopped.
How are you using the lua-language-server?
Command Line
Which OS are you using?
Windows WSL
What is the issue affecting?
Other
Expected Behaviour
Document generation, as documented here:
https://luals.github.io/wiki/usage/#--doc
Actual Behaviour
Reproduction steps
lua-language-server --doc <path-to-folder>
Additional Notes
I tried this on both Windows and WSL with the same result.
Log File
No response