Problem
lua_ls is registered in lsp.lua but has no settings configured. This causes false undefined-global warnings for vim and LazyVim globals in Neovim config files.
Solution
Add proper lua_ls settings to nvim/.config/nvim/lua/plugins/lsp.lua:
lua_ls = {
mason = not is_nixos,
settings = {
Lua = {
runtime = { version = "LuaJIT" },
workspace = {
checkThirdParty = false,
library = vim.api.nvim_get_runtime_file("", true),
},
diagnostics = {
globals = { "vim", "LazyVim" },
},
telemetry = { enable = false },
},
},
},
Expected Result
- No more
undefined-global warnings for vim and LazyVim
- Proper Neovim API completions and type checking in Lua config files
Problem
lua_lsis registered inlsp.luabut has no settings configured. This causes falseundefined-globalwarnings forvimandLazyVimglobals in Neovim config files.Solution
Add proper
lua_lssettings tonvim/.config/nvim/lua/plugins/lsp.lua:Expected Result
undefined-globalwarnings forvimandLazyVim