Tencent / LuaHelper

LuaHelper is a High-performance lua VSCode plugin, Language Server Protocol for lua.
Other
603 stars 93 forks source link

[Feature]: make `lualsp.exe` more available to use #64

Open younger-1 opened 2 years ago

younger-1 commented 2 years ago

I have attemped to add it to lspconfig in my local machine with following settings https://github.com/younger-1/nvim-lspconfig/commit/c3e0e977d40d5fd05452ba2e62258aa724a36e3a. And I can't make luahelper LS attach to my buffer.

This is what I have tried:

local default_opts = {
  on_attach = on_attach,
  capabilities = capabilities,
  -- cmd = { "C:\\Users\\younger\\.local\\share\\nvim-data\\lsp_servers\\sumneko_lua\\extension\\server\\bin\\Windows\\lua-language-server" },
  cmd = { "C:\\Users\\younger\\.vscode\\extensions\\yinfei.luahelper-0.2.9\\server\\lualsp", "--stdio" },
}
-- require 'lspconfig'.sumneko_lua.setup(default_opts)
require 'lspconfig'.luahelper.setup(default_opts)

And sumneko_lua can work properly.

williamboman commented 2 years ago

I haven't tried this locally yet, but I believe you have to set a mode for it. Neovim's client uses stdin/stdout, so I think -mode 1 is needed:

cmd = { "C:\\Users\\younger\\.vscode\\extensions\\yinfei.luahelper-0.2.9\\server\\lualsp", "-mode", "1" },
younger-1 commented 2 years ago

Sorry for my mistake. Now LS launch successfully.

williamboman commented 2 years ago

不过我同意原海报。 这似乎是一个很好的实现,并且有更多的编辑器而不仅仅是 VSCode 会从中受益匪浅。 在 VSCode 上下文之外安装它的推荐方法是什么? 是要克隆存储库并运行在/luahelper-vscode/server/ 中找到的二进制文件吗?

如果翻译不好,请见谅。 您可以在下面找到英文原文。

English I agree with the original poster though. This seems like a great implementation, and there are more editors than just VSCode that would benefit greatly from this. What is the recommended way to install this outside of a VSCode context? Is to to clone the repository and run the binaries found inside `/luahelper-vscode/server/`? Sorry if the translation is bad. You can find the original English text below.
younger-1 commented 2 years ago

@williamboman this is also the only way to use the server for me 🤣