LuaLS / lua-language-server

A language server that offers Lua language support - programmed in Lua
https://luals.github.io
MIT License
3.12k stars 289 forks source link

lua-language-server --check always return subprocess::spawn: (system:2)No such file or directory #2683

Open Freed-Wu opened 1 month ago

Freed-Wu commented 1 month ago

How are you using the lua-language-server?

Command Line

Which OS are you using?

Linux

What is the issue affecting?

Diagnostics/Syntax Checking

Expected Behaviour

NO error.

Actual Behaviour

❯ lua-language-server --check
subprocess::spawn: (system:2)No such file or directory

Reproduction steps

lua-language-server --check

Additional Notes

No response

Log File

No response

syyyr commented 4 weeks ago

It seems to me, that this patch https://github.com/LuaLS/lua-language-server/commit/38d83324671b4110614dbef30acef4a1543ee065 made it stop working.

The offending line is this one https://github.com/LuaLS/lua-language-server/blob/e2ca72dd54da1cafda36ff9e1266526fec54081f/script/cli/check.lua#L11

It looks like the executable name is in arg[-2] instead of arg[-1]. For me, arg[-1] holds -E, which is used as the program name when executing the check workers (confirmed by strace)