Skip to content

Commit

Permalink
fix: neovim v0.10.1 compatibility (fix #408)
Browse files Browse the repository at this point in the history
  • Loading branch information
boltlessengineer committed Aug 23, 2024
1 parent e51fff1 commit 7e7dcfc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions lua/rest-nvim/context.lua
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,20 @@ end
---@param key string
---@param value string
function Context:set_global(key, value)
vim.validate("key", key, "string")
vim.validate("value", value, "string")
vim.validate({
key = { key, "string" },
value = { value, "string" },
})
self.vars[key] = value
end

---@param key string
---@param value string
function Context:set_local(key, value)
vim.validate("key", key, "string")
vim.validate("value", value, "string")
vim.validate({
key = { key, "string" },
value = { value, "string" },
})
self.lv[key] = value
end

Expand Down
2 changes: 1 addition & 1 deletion lua/rest-nvim/parser/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ end
---@param ctx rest.Context
---@param endline number zero-based line number
function parser.eval_context(source, ctx, endline)
vim.validate("source", source, "number")
vim.validate({ source = { source, "number" } })
local startline = ctx.linenr
for ln = startline, endline do
local start_node = vim.treesitter.get_node({ pos = { ln, 0 } })
Expand Down

0 comments on commit 7e7dcfc

Please sign in to comment.