fix(lspconfig): use safer 0.11 compatibility check (#3265)

Previously only the minor version has been checked for equality, which
means it is brittle whenever we reach 0.12. Independently of when this
is expected to be removed, it's simply much safer to check if the
expected functionality is available by testing `vim.lsp.config` for nil.

Fixes 84f8170fda
This commit is contained in:
Levente Polyak
2025-04-25 02:56:24 +05:30
committed by GitHub
parent 4765c80114
commit d5ea76925f
+1 -1
View File
@@ -72,7 +72,7 @@ M.defaults = function()
-- Support 0.10 temporarily -- Support 0.10 temporarily
if vim.version().minor == 11 then if vim.lsp.config then
vim.lsp.config("*", { capabilities = M.capabilities, on_init = M.on_init }) vim.lsp.config("*", { capabilities = M.capabilities, on_init = M.on_init })
vim.lsp.config("lua_ls", { settings = lua_lsp_settings }) vim.lsp.config("lua_ls", { settings = lua_lsp_settings })
vim.lsp.enable "lua_ls" vim.lsp.enable "lua_ls"