Skip to content

Commit d90d39e

Browse files
utils: use non-deprecated vim.validate form for Nvim 0.11 (#244)
1 parent ed8f808 commit d90d39e

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

lua/null-ls/config.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local u = require("null-ls.utils")
22

3-
local validate = vim.validate
3+
local validate = u.validate
44

55
local defaults = {
66
cmd = { "nvim" },

lua/null-ls/sources.lua

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ local methods = require("null-ls.methods")
44
local s = require("null-ls.state")
55
local u = require("null-ls.utils")
66

7-
local validate = vim.validate
7+
local validate = u.validate
88

99
local registered = {
1010
names = {},

lua/null-ls/utils/init.lua

+11
Original file line numberDiff line numberDiff line change
@@ -370,4 +370,15 @@ M.get_vcs_root = function()
370370
return vcs_root
371371
end
372372

373+
M.validate = function(validators)
374+
if vim.fn.has("nvim-0.11.0") ~= 1 then
375+
vim.validate(validators)
376+
return
377+
end
378+
379+
for vname, spec in pairs(validators) do
380+
vim.validate(vname, spec[1], spec[2], spec[3])
381+
end
382+
end
383+
373384
return M

0 commit comments

Comments
 (0)