From 92591015e5a27f158e3d5b5c3efbd73073103ebb Mon Sep 17 00:00:00 2001 From: siduck76 Date: Sun, 18 Apr 2021 11:27:06 +0530 Subject: [PATCH] add sumneko_lua lspconfig --- lua/lspconfig/lua.lua | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/lua/lspconfig/lua.lua b/lua/lspconfig/lua.lua index ac7f1d2..ff2887d 100644 --- a/lua/lspconfig/lua.lua +++ b/lua/lspconfig/lua.lua @@ -49,3 +49,27 @@ for k, lang in pairs(servers) do end } end + +-- lua lsp settings +USER = "/home/" .. vim.fn.expand("$USER") + +local sumneko_root_path = USER .. "/.config/lua-language-server" +local sumneko_binary = USER .. "/.config/lua-language-server/bin/Linux/lua-language-server" + +require "lspconfig".sumneko_lua.setup { + cmd = {sumneko_binary, "-E", sumneko_root_path .. "/main.lua"}, + settings = { + Lua = { + runtime = { + version = "LuaJIT", + path = vim.split(package.path, ";") + }, + diagnostics = { + globals = {"vim"} + }, + workspace = { + library = {[vim.fn.expand("$VIMRUNTIME/lua")] = true, [vim.fn.expand("$VIMRUNTIME/lua/vim/lsp")] = true} + } + } + }, +}