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

Need help with running lua lsp in a docker container #2718

Open ankushKun opened 2 weeks ago

ankushKun commented 2 weeks ago

Hi, this is what I am trying to do:

Setup:

Issue faced:

When I run just the lua-language-server command, it seems to be running, but when I specify a socket, it does not start and gives a connection refused error.

image

image

moreover when I install the lsp on my mac machine and run the same command, it doesnot throw and error and seems to run silently

image

If anyone needs any additional details please let me know

Dockerfile:

# Use the official Homebrew Docker image as the base
FROM homebrew/brew:latest

# Install lua-language-server
RUN brew install lua-language-server

# Verify installation
RUN lua-language-server --version

# Set working directory
WORKDIR /workspace

# ENTRYPOINT ["lua-language-server --socket=5000"]

# CMD ["lua-language-server", "--socket=5000"]

EXPOSE 5000

CMD ["bash"]

tried both ENTRYPOINT and CMD, same results, which is why I used bash and interactive mode to debug

Thanks

CppCXY commented 2 weeks ago

Even if it is connected through a socket, luals must be in the same place as the runtime environment., because if the language server and the target workspace are not on the same machine, the language server cannot correctly load the workspace. LSP does not specify how to send workspace content to the LS, so general language server load the workspace by scanning the rootPath path passed in by LSP client. Currently, to truly support WebIDE, LuaLs must be compiled into wasm. There are no plans or progress in this regard at the moment.

ankushKun commented 2 weeks ago

I see.

Currently, to truly support WebIDE, LuaLs must be compiled into wasm

Could you point me to any resources regarding this? if any

CppCXY commented 2 weeks ago

Could you point me to any resources regarding this? if any

discuss in https://github.com/LuaLS/lua-language-server/issues/1689