From f4f67935d6450958ed719cd2f07165c9320a902a Mon Sep 17 00:00:00 2001 From: Alex Yatskov Date: Sun, 22 Jan 2023 18:31:05 -0800 Subject: [PATCH] Update lua config --- lua/.luarc.json | 4 ---- lua/lsp.lua | 22 ++++++++++++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) delete mode 100644 lua/.luarc.json diff --git a/lua/.luarc.json b/lua/.luarc.json deleted file mode 100644 index e1b9d70..0000000 --- a/lua/.luarc.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "$schema": "https://raw.githubusercontent.com/sumneko/vscode-lua/master/setting/schema.json", - "Lua.workspace.checkThirdParty": false -} \ No newline at end of file diff --git a/lua/lsp.lua b/lua/lsp.lua index 91662c8..cd20ca2 100644 --- a/lua/lsp.lua +++ b/lua/lsp.lua @@ -21,13 +21,27 @@ if vim.fn.executable('typescript-language-server') then nvim_lspconfig.tsserver.setup({capabilities = capabilities}) end if vim.fn.executable('lua-language-server') then + local runtime_path = vim.split(package.path, ';') + table.insert(runtime_path, 'lua/?.lua') + table.insert(runtime_path, 'lua/?/init.lua') + nvim_lspconfig.sumneko_lua.setup({ settings = { Lua = { - diagnostics = {globals = {'vim'}}, - runtime = {version = 'LuaJIT'}, - telemetry = {enable = false}, - workspace = {library = vim.api.nvim_get_runtime_file('', true)}, + diagnostics = { + globals = {'vim'}, + }, + runtime = { + path = runtime_path, + version = 'LuaJIT', + }, + telemetry = { + enable = false, + }, + workspace = { + checkThirdParty = false, + library = vim.api.nvim_get_runtime_file('', true), + }, }, }, })