mirror of
https://github.com/LazyVim/LazyVim.git
synced 2026-03-10 09:27:25 +00:00
feat(core): relax hard requirement for vim.lsp.is_enabled. Show warning instead
This commit is contained in:
@@ -1,23 +1,20 @@
|
|||||||
local fail = nil
|
|
||||||
if vim.fn.has("nvim-0.11.2") == 0 then
|
if vim.fn.has("nvim-0.11.2") == 0 then
|
||||||
fail = {
|
vim.api.nvim_echo({
|
||||||
{ "LazyVim requires Neovim >= 0.11.2\n", "ErrorMsg" },
|
{ "LazyVim requires Neovim >= 0.11.2\n", "ErrorMsg" },
|
||||||
{ "For more info, see: https://github.com/LazyVim/LazyVim/issues/6421\n", "Comment" },
|
{ "For more info, see: https://github.com/LazyVim/LazyVim/issues/6421\n", "Comment" },
|
||||||
{ "Press any key to exit", "MoreMsg" },
|
{ "Press any key to exit", "MoreMsg" },
|
||||||
}
|
}, true, {})
|
||||||
elseif vim.fn.has("nvim-0.12") == 1 and not vim.lsp.is_enabled then
|
|
||||||
fail = {
|
|
||||||
{ "LazyVim requires Neovim >= 0.11.2 or a recent Nightly\n", "ErrorMsg" },
|
|
||||||
{ "Your nightly is too old, please update to a more recent version.\n", "Comment" },
|
|
||||||
{ "Press any key to exit", "MoreMsg" },
|
|
||||||
}
|
|
||||||
end
|
|
||||||
|
|
||||||
if fail then
|
|
||||||
vim.api.nvim_echo(fail, true, {})
|
|
||||||
vim.fn.getchar()
|
vim.fn.getchar()
|
||||||
vim.cmd([[quit]])
|
vim.cmd([[quit]])
|
||||||
return {}
|
return {}
|
||||||
|
elseif not vim.lsp.is_enabled then
|
||||||
|
vim.schedule(function()
|
||||||
|
LazyVim.warn({
|
||||||
|
"You're using an **old** `nightly` version of **Neovim**",
|
||||||
|
"Please update to a recent `nightly`,",
|
||||||
|
"or a stable version (`>= 0.11.2`).",
|
||||||
|
})
|
||||||
|
end)
|
||||||
end
|
end
|
||||||
|
|
||||||
require("lazyvim.config").init()
|
require("lazyvim.config").init()
|
||||||
|
|||||||
@@ -235,7 +235,7 @@ return {
|
|||||||
})
|
})
|
||||||
end
|
end
|
||||||
|
|
||||||
if vim.lsp.is_enabled("denols") and vim.lsp.is_enabled("vtsls") then
|
if vim.lsp.is_enabled and vim.lsp.is_enabled("denols") and vim.lsp.is_enabled("vtsls") then
|
||||||
---@param server string
|
---@param server string
|
||||||
local resolve = function(server)
|
local resolve = function(server)
|
||||||
local markers, root_dir = vim.lsp.config[server].root_markers, vim.lsp.config[server].root_dir
|
local markers, root_dir = vim.lsp.config[server].root_markers, vim.lsp.config[server].root_dir
|
||||||
|
|||||||
Reference in New Issue
Block a user