From 6adb1f506f472174d5c4d9c226f824c676b0bff9 Mon Sep 17 00:00:00 2001 From: Sonny Bakker Date: Tue, 18 Mar 2025 20:16:43 +0100 Subject: [PATCH] Add additional configuration for lua lsp --- group_vars/arch/neovim.yml | 2 +- templates/nvim/lua/lsp.lua.j2 | 12 ++++++++++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/group_vars/arch/neovim.yml b/group_vars/arch/neovim.yml index 6963cd8..de53353 100644 --- a/group_vars/arch/neovim.yml +++ b/group_vars/arch/neovim.yml @@ -29,7 +29,7 @@ language_servers: - package: lua-language-server server_name: 'lua_ls' - auto_setup: true + auto_setup: false - package: yaml-language-server server_name: 'yamlls' diff --git a/templates/nvim/lua/lsp.lua.j2 b/templates/nvim/lua/lsp.lua.j2 index 8a09c38..7e9c221 100644 --- a/templates/nvim/lua/lsp.lua.j2 +++ b/templates/nvim/lua/lsp.lua.j2 @@ -95,6 +95,18 @@ nvim_lsp.jsonls.setup { capabilities = snippet_capabilities, } +nvim_lsp.lua_ls.setup { + on_attach = on_attach, + capabilities = snippet_capabilities, + settings = { + Lua = { + diagnostics = { + globals = { 'vim' } + } + } + } +} + {% endif %} nvim_lsp.yamlls.setup { on_attach = on_attach,