fix: get_range shim for playground

This commit is contained in:
Tom van Dijk 2023-03-24 22:44:28 +01:00 committed by Lewis Russell
parent cb568af539
commit 5c3e8dee64
3 changed files with 12 additions and 11 deletions

View file

@ -1,5 +1,6 @@
-- Shim module to address deprecations across nvim versions
local tsq = vim.treesitter.query
local ts = vim.treesitter
local tsq = ts.query
local M = {}
@ -15,4 +16,8 @@ function M.parse_query(lang, query)
return (tsq.parse or tsq.parse_query)(lang, query)
end
function M.get_range(node, source, metadata)
return (ts.get_range or tsq.get_range)(node, source, metadata)
end
return M