diff --git a/home/editors/lsp.nix b/home/editors/lsp.nix index 8518592..e230e02 100644 --- a/home/editors/lsp.nix +++ b/home/editors/lsp.nix @@ -13,9 +13,10 @@ nodePackages.vscode-langservers-extracted nodePackages.typescript-language-server nodePackages.dockerfile-language-server-nodejs - haskellPackages.haskell-language-server nodePackages.diagnostic-languageserver + haskellPackages.haskell-language-server rust-analyzer + sumneko-lua-language-server # linters & formatters nodePackages.eslint diff --git a/home/editors/neovim/lsp/lsp.lua b/home/editors/neovim/lsp/lsp.lua index 9052e76..f21c850 100644 --- a/home/editors/neovim/lsp/lsp.lua +++ b/home/editors/neovim/lsp/lsp.lua @@ -50,7 +50,32 @@ config.omnisharp.setup{ cmd = {"omnisharp", "--languageserver", "--hostPID", tostring(pid)}, } -config.diagnosticls.setup{ +local runtime_path = vim.split(package.path, ';') +table.insert(runtime_path, "lua/?.lua") +table.insert(runtime_path, "lua/?/init.lua") + +config.sumneko_lua.setup { + capabilities = capabilities, + settings = { + Lua = { + runtime = { + version = "LuaJIT", + path = runtime_path, + }, + diagnostics = { + globals = {"vim"}, + }, + workspace = { + library = vim.api.nvim_get_runtime_file("", true), + }, + telemetry = { + enable = false, + }, + }, + }, +} + +config.diagnosticls.setup { on_attach = diagnosticls_on_attach, filetypes = { "javascript",