LuaLS / lua-language-server

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

[Question]How to build on Windows ? #39

Closed AmjadHD closed 5 years ago

sumneko commented 5 years ago

You could just install it in VSCode. Search Lua in Extension page, then you can see it which publisher is sumneko. If you always want to get the latest version as soon as possible, You just need to update lua files manually. Did you have other requirements for compiling your own version on Windows?

AmjadHD commented 5 years ago

I want to try it out in sublime text via it's LSP client.

sumneko commented 5 years ago

You can install it in VSCode, then copy the server folder. The way to start the service can be referred to here: https://github.com/sumneko/lua-language-server/blob/master/client/src/extension.ts

AmjadHD commented 5 years ago

I tried with this command:

            [
                "D:/Downloads/Archives/sumneko.lua-0.9.7/extension/server/bin/lua-language-server",
                "-E",
                "-e",
                "LANG=\"en-US\"",
                "D:/Downloads/Archives/sumneko.lua-0.9.7/extension/server/main.lua"
            ],

but I failed, this is the client's log:

LSP: global configs ['polymer-ide=False', 'ocaml=False', 'vscode-json=True', 'javascript-typescript-langserver=False', 'jdtls=True', 'typescript-language-server=False', 'lsp-tsserver=True', 'pyls=True', 'vscode-css=True', 'metals=False', 'haskell-ide-engine=False', 'clangd=False', 'eslint=False', 'reason=False', 'phpls=False', 'vscode-html=True', 'cquery=False', 'rls=True', 'gopls=False', 'bashls=False', 'golsp=False', 'kotlinls=True', 'lua-ls=True', 'xml-ls=True', 'mspyls=False', 'julials=False']
LSP: window 2 starting 1 initial views
LSP: window 2 requests lua-ls for D:\Downloads\Archives\sumneko.lua-0.9.7\extension\server\main.lua
LSP: starting in C:\Users\Lehdhili\AppData\Roaming\Sublime Text 3\Packages\hover-preview
LSP: starting ['D:/Downloads/Archives/sumneko.lua-0.9.7/extension/server/bin/lua-language-server', '-E', '-e', 'LANG="en-US"', 'D:/Downloads/Archives/sumneko.lua-0.9.7/extension/server/main.lua']
LSP:  --> initialize
LSP: window 2 added session lua-ls
server: D:/Downloads/Archives/sumneko.lua-0.9.7/extension/server/bin/lua-language-server: ...ads/Archives/sumneko.lua-0.9.7/extension/server/main.lua:13: module 'log' not found:
server: no field package.preload['log']
server: no file 'C:/Users/Lehdhili/AppData/Roaming/Sublime Text 3/Packages/hover-preview/src/log.lua'
server: no file 'C:/Users/Lehdhili/AppData/Roaming/Sublime Text 3/Packages/hover-preview/src/log/init.lua'
server: no file 'D:\Downloads\Archives\sumneko.lua-0.9.7\extension\server\bin\log.dll'
server: no file 'D:\Downloads\Archives\sumneko.lua-0.9.7\extension\server\bin\..\lib\lua\5.4\log.dll'
server: no file 'D:\Downloads\Archives\sumneko.lua-0.9.7\extension\server\bin\loadall.dll'
server: no file '.\log.dll'
server: stack traceback:
server: [C]: in function 'require'
server: ...ads/Archives/sumneko.lua-0.9.7/extension/server/main.lua:13: in main chunk
server: [C]: in ?
LSP: LSP stream logger stopped.
LSP: LSP stdout process ended.
sumneko commented 5 years ago

Please update the script manually and try again.

AmjadHD commented 5 years ago

Thanks 👍 , that did it, I already tried to monkey-patch main.lua and set ROOT to the server path hoping to fix it, but Lua is not my cop of tea 😄 .