From f1b295db43e5daccc9f12c8d211490f46761315d Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 3 Jan 2025 00:15:36 +0100 Subject: [PATCH] chore(neovim): rework lua lsp configuration --- .../home-manager/cli/neovim/files/lspconfig.lua | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/modules/home-manager/cli/neovim/files/lspconfig.lua b/modules/home-manager/cli/neovim/files/lspconfig.lua index a7df681..a672376 100644 --- a/modules/home-manager/cli/neovim/files/lspconfig.lua +++ b/modules/home-manager/cli/neovim/files/lspconfig.lua @@ -77,6 +77,21 @@ vim.api.nvim_create_autocmd("FileType", { lspconfig.lua_ls.setup { capabilities = capabilities, single_file_support = true, + settings = { + Lua = { + diagnostics = { + globals = {'vim'} -- Add any globals you want to ignore as undefined + }, + workspace = { + library = { + [vim.fn.expand('$VIMRUNTIME/lua')] = true + } + }, + telemetry = { + enable = false -- Disable telemetry + } + } + }, flags = { debounce_text_changes = 150, } @@ -192,7 +207,7 @@ vim.api.nvim_create_autocmd('LspAttach', { -- Jumps to the definition of the type symbol bufmap('n', 'go', 'lua vim.lsp.buf.type_definition()') - -- Lists all the references + -- Lists all the references bufmap('n', 'gr', 'lua vim.lsp.buf.references()') -- Displays a function's signature information