From 97dcde8c3244e8c97fbbd028443e47aba049dc4e Mon Sep 17 00:00:00 2001 From: hankertrix <91734413+hankertrix@users.noreply.github.com> Date: Wed, 1 Feb 2023 04:39:35 +0000 Subject: [PATCH] Changed the configuration for sumneko_lua to the one recommended by nvim-lspconfig. --- after/plugin/lsp.lua | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/after/plugin/lsp.lua b/after/plugin/lsp.lua index 85cc34eb..31a6f448 100644 --- a/after/plugin/lsp.lua +++ b/after/plugin/lsp.lua @@ -8,12 +8,26 @@ lsp.ensure_installed({ 'rust_analyzer', }) --- Fix Undefined global 'vim' +-- Set up sumneko_lua according to the +-- recommended settings by nvim-lspconfig lsp.configure('sumneko_lua', { settings = { Lua = { + runtime = { + -- Tell the language server which version of Lua you're using (most likely LuaJIT in the case of Neovim) + version = "LuaJIT" + }, diagnostics = { + -- Get the langauge server to recognize the `vim` global globals = { 'vim' } + }, + workspace = { + -- Make the server aware of Neovim runtime files + library = vim.api.nvim_get_runtime_file("", true) + }, + -- Do not send telemetry data containing a randomized but unique identifier + telemetry = { + enable = false } } }