mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-02 19:46:58 -04:00
fix: get_range shim for playground
This commit is contained in:
parent
cb568af539
commit
5c3e8dee64
3 changed files with 12 additions and 11 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue