mirror of
https://github.com/neovim/neovim.git
synced 2024-12-20 11:15:14 -07:00
fix(treesitter): add missing deprecate
This commit is contained in:
parent
cbbf8bd666
commit
ac7397f4a0
@ -1,5 +1,4 @@
|
||||
local Range = require('vim.treesitter._range')
|
||||
local Query = require('vim.treesitter.query')
|
||||
|
||||
local api = vim.api
|
||||
|
||||
@ -105,7 +104,7 @@ local function get_folds_levels(bufnr, info, srow, erow)
|
||||
local prev_stop = -1
|
||||
|
||||
vim.treesitter.get_parser(bufnr):for_each_tree(function(tree, ltree)
|
||||
local query = vim.treesitter.query.get_query(ltree:lang(), 'folds')
|
||||
local query = vim.treesitter.query.get(ltree:lang(), 'folds')
|
||||
if not query then
|
||||
return
|
||||
end
|
||||
@ -115,7 +114,7 @@ local function get_folds_levels(bufnr, info, srow, erow)
|
||||
|
||||
for id, node, metadata in query:iter_captures(tree:root(), bufnr, srow or 0, q_erow) do
|
||||
if query.captures[id] == 'fold' then
|
||||
local range = Query.get_range(node, bufnr, metadata[id])
|
||||
local range = vim.treesitter.get_range(node, bufnr, metadata[id])
|
||||
local start, _, stop, stop_col = Range.unpack4(range)
|
||||
|
||||
if stop_col == 0 then
|
||||
|
@ -196,12 +196,9 @@ function M.set(lang, query_name, text)
|
||||
end
|
||||
|
||||
---@deprecated
|
||||
---@param lang string Language to use for the query
|
||||
---@param query_name string Name of the query (e.g. "highlights")
|
||||
---
|
||||
---@return Query|nil Parsed query
|
||||
function M.get_query(lang, query_name)
|
||||
return M.get(lang, query_name)
|
||||
function M.get_query(...)
|
||||
vim.deprecate('vim.treesitter.query.get_query()', 'vim.treesitter.query.get()', '0.10')
|
||||
return M.get(...)
|
||||
end
|
||||
|
||||
--- Returns the runtime query {query_name} for {lang}.
|
||||
|
Loading…
Reference in New Issue
Block a user