-
-
Notifications
You must be signed in to change notification settings - Fork 328
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
Build/Use outside of VSCode #60
Comments
If you are on Windows, you can download this extension then copy the |
So, I actually went through the steps by installing VSCode, and etc, but in that process I learned what the real build steps were. They were defined in git clone [email protected]:sumneko/lua-language-server.git
cd lua-language-server
# PreCompile
cd 3rd/luamake/
ninja -f ninja/linux.ninja
cd ../../
# Compile
3rd/luamake/luamake rebuild
# Run
server/bin/lua-language-server -E -e LANG=en server/main.lua You could put this in a Here's a 30 second version: run: server/bin/lua-language-server
server/bin/lua-language-server -E -e LANG=en server/main.lua
server/bin/lua-language-server: 3rd/luamake/luamake
3rd/luamake/luamake rebuild
3rd/luamake/luamake:
cd 3rd/luamake && ninja -f ninja/linux.ninja Note to others:
|
Works well! @sumneko consider adding the instructions I made above to the README. I could open a PR if you're interested. |
Drop-by comment. I was looking for a Lua language server and just came across this project. @sumneko Please add a wiki page and probably make it publicly editable https://help.github.com/en/articles/changing-access-permissions-for-wikis Users of editors other than VSCode can benefit from the build instructions here. |
For anyone finding these instructions now, @norcalli's comment needs two modifications:
It would be really great if, as @MaskRay suggests, there was a wiki where we could put these build instructions, or section of the README, a Makefile, etc. |
I have create a wiki page for building and runing. |
@wbthomason @MaskRay @sumneko Since opening this PR, I have since joined the neovim team and wrote the builtin client for neovim I wrote a script to auto install it that you can reference, and it has the benefit that it will be maintained by the neovim contributors. I added a step to download ninja if you don't have it. Here's the PR https://github.com/neovim/nvim-lsp/pull/49/files#diff-b4f1130fbd1295c6654d11c3dd94b1e7 And here's the install script https://github.com/neovim/nvim-lsp/blob/ddd62036c8509a8a9fd78595fdcf53884bd02f7f/lua/nvim_lsp/sumneko_lua.lua#L32 You may find our automatic extension scraping and settings generation especially useful. You can see it in the README.md. I scrape the package.json for settings. |
mainstream packager for lua projects is https://luarocks.org/. It would be very cool to see a rockspec for it. It's quite simple to write. |
I got the server running outside of VSCode. Like @sumneko suggests I copied the server folder from the extension and ran it with the command: bin\Windows\lua-language-server.exe -E main.lua Now I just don't understand how I can access it? How do I send him the code of my file so that the Lua LS can send me his suggestions? Context: I work with Angular 8 and the Monaco Editor (core of VSCode) on a IDE, it's only used locally. To connect Monaco to an LSP I use the Monaco Editor Language Client (https://github.com/TypeFox/monaco-languageclient), it provides a language client that establishes communication between Monaco editors and language servers over JSON-RPC via WebSockets. |
@weisa-san Currently the language server only supports connection by standard output and standard input. |
I got it working with neovim, using the coc.nvim plugin, in my Linux machine. The steps are similar to @norcalli 's. # Clone the repository recursively into a desired folder
# in my case $HOME/.lua-language-server/
git clone --recursive [email protected]:sumneko/lua-language-server.git .lua-language-server/
# PreCompile with ninja, you must have this package
cd .lua-language-server/3rd/luamake/
ninja -f ninja/linux.ninja
# Compile
cd ../../
3rd/luamake/luamake rebuild
# Run
cd ../
.lua-language-server/bin/Linux/lua-language-server -E -e LANG=en .lua-language-server/main.lua If everything went OK, the command won't return and wont' print anything, until you Ctrl+C. "languageserver": {
"lua": {
// FIXME: avoid absolute paths
"cwd": "/home/myUserName/",
"command": "/home/myUserName/.lua-language-server/bin/Linux/lua-language-server",
"args": ["-E", "-e", "LANG=\"en\"", ".lua-language-server/main.lua"],
"filetypes": [
"lua"
]
}
}, |
|
That's actually this issue I was able to compile removing the tests (both on 3rd/luamake/3rd/bee and 3rd/bee). The But meanwhile, commenting out the lm:default {
'install',
- 'test',
+ -- 'test',
'unittest',
} |
@gagbo: If you could try the steps in actboy168/bee.lua#8 (comment) and report if you get any more information in actboy168/bee.lua#8, that would be helpful! |
Has been integrated into neovim. |
But there are other editors than VSCode and neovim :( Either way, I think the issue I mentionned earlier has been fixed, I didn't need extra steps to get it working after reinstalling recently. 👍 |
@weisa-san I also tried to connect this language server to a Monaco Editor running in the browser and finally got a working example: https://github.com/arnoson/monaco-lua-example |
I've been looking for a good lua language server since I've found EmmyLua to be a little unreliable. I want to use this with vim, which just requires running the server, but I don't see instructions for how to build the server standalone.
Is it possible to run as a stdio server so I could use it with vim?
The text was updated successfully, but these errors were encountered: