aboutsummaryrefslogtreecommitdiffstats
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/lspconfig.lua18
1 files changed, 16 insertions, 2 deletions
diff --git a/lua/lspconfig.lua b/lua/lspconfig.lua
index eb5fa666..e1e6084d 100644
--- a/lua/lspconfig.lua
+++ b/lua/lspconfig.lua
@@ -48,6 +48,20 @@ M.server_aliases = function(name)
return used_aliases
end
+-- Temporary port of Nvim 0.10 vim.version:tostring.
+---@param version vim.Version
+local function version_string(version)
+ assert(version.major and version.minor and version.patch, 'invalid vim.Version table')
+ local ret = table.concat({ version.major, version.minor, version.patch }, '.')
+ if version.prerelease then
+ ret = ret .. '-' .. version.prerelease
+ end
+ if version.build and version.build ~= vim.NIL then
+ ret = ret .. '+' .. version.build
+ end
+ return ret
+end
+
local mt = {}
function mt:__index(k)
if configs[k] == nil then
@@ -80,8 +94,8 @@ local minimum_neovim_version = '0.9'
if vim.fn.has('nvim-' .. minimum_neovim_version) == 0 then
local msg = string.format(
'nvim-lspconfig requires Nvim version %s, but you are running: %s',
- vim.version.parse(minimum_neovim_version),
- vim.version()
+ minimum_neovim_version,
+ vim.version and version_string(vim.version()) or 'older than v0.5.0'
)
error(msg)
end