lua-language-server icon indicating copy to clipboard operation
lua-language-server copied to clipboard

`--version` command returns `<Unknown>` when lua-language-server installed via homebrew

Open yoichimichael opened this issue 8 months ago • 1 comments

How are you using the lua-language-server?

NeoVim

Which OS are you using?

MacOS

What is the issue affecting?

Annotations

Expected Behaviour

Running lua-language-server --version should return x.x.x

Actual Behaviour

Running lua-language-server --version returns <Unknown>

Reproduction steps

  1. Install lua-language-server via homebrew
  2. Run lua-language-server --version
  3. See '<Unknown>'

Additional Notes

Running brew list --versions I can see that I have v3.14.0 installed. However, running lua-language-server --version from the command line returns <Unknown>.

This comports with the readout from running :LspInfo within neovim:

- lua_ls (id: 1)
  - Version: <Unknown>
  - Root directory: ~/.config/nvim
  - Command: { "lua-language-server" }
  - Settings: {
      Lua = {
        runtime = {
          version = "LuaJIT"
        },
        workspace = {
          checkThirdParty = false,
          library = { "/opt/homebrew/Cellar/neovim/0.11.1/share/nvim/runtime", "${3rd}/luv/library" }
        }
      }
    }
  - Attached buffers: 1, 4

Log File

No response

yoichimichael avatar May 03 '25 19:05 yoichimichael

Looking at LuaLS's source code, the version is read from changelog.md. I don't know if this is the normal practice, but currently LuaLS is doing this way. 🙈 https://github.com/LuaLS/lua-language-server/blob/759e8fbcce257a65ab469a49d5878286e9e7e089/script/version.lua#L3-L24


Seems that the installation from brew is missing this changelog.md, so the server cannot find the version 🤔 . Meanwhile I believe the homebrew package is NOT maintained by authors of LuaLS (?) https://github.com/LuaLS/lua-language-server/issues/232#issuecomment-932662829

  • https://formulae.brew.sh/formula/lua-language-server
  • https://github.com/Homebrew/homebrew-core/blob/2f3fe11a058ccc5938c63824609fb38772431525/Formula/l/lua-language-server.rb

Maybe you have to report to homebrew-core repo instead ? Or you may try to @ mention recent contributor of the above formula file to see if they can provide some quick fixes for it. 👀

tomlau10 avatar May 04 '25 05:05 tomlau10