Added vim to lsp global variables in order to remove warnings

This commit is contained in:
Philippe Zwietering
2023-04-13 13:43:57 +02:00
parent e2780cfe9d
commit 256497cbaa

View File

@@ -8,6 +8,28 @@ lsp.ensure_installed({
'jedi_language_server', -- Python 'jedi_language_server', -- Python
}) })
-- Fix undefined global 'vim'
lsp.configure('lua_ls', {
cmd = { 'lua-language-server' },
settings = {
Lua = {
runtime = {
version = 'LuaJIT',
path = vim.split(package.path, ';'),
},
diagnostics = {
globals = { 'vim' },
},
workspace = {
library = {
[vim.fn.expand('$VIMRUNTIME/lua')] = true,
[vim.fn.expand('$VIMRUNTIME/lua/vim/lsp')] = true,
},
},
},
},
})
lsp.on_attach(function(client, bufnr) lsp.on_attach(function(client, bufnr)
lsp.default_keymaps({buffer = bufnr}) lsp.default_keymaps({buffer = bufnr})
end) end)