M lua/complementree/init.lua => lua/complementree/init.lua +1 -1
@@ 62,7 62,7 @@ local function get_completion(ft, line_to_cursor, lnum, _col)
for q, sub in pairs(ft_completion) do
if vim.startswith(q, '(') then
- local query = vim.treesitter.parse_query(ft, q)
+ local query = vim.treesitter.query.parse(ft, q)
for id, node in query:iter_captures(root, 0, l, l + 1) do
local cname = query.captures[id]
if tsutils.is_in_node_range(node, l, c) then
M lua/complementree/sources.lua => lua/complementree/sources.lua +1 -1
@@ 407,7 407,7 @@ function Sources.treesitter_matches(opts)
if node then
items[#items + 1] = {
- word = vim.treesitter.query.get_node_text(node, 0),
+ word = vim.treesitter.get_node_text(node, 0),
kind = kind,
icase = 1,
dup = 0,
M teal/complementree/init.tl => teal/complementree/init.tl +1 -1
@@ 62,7 62,7 @@ local function get_completion(ft: string, line_to_cursor: string, lnum: integer,
for q, sub in pairs(ft_completion) do
-- Queries always start with a parenthesis
if vim.startswith(q, '(') then
- local query = vim.treesitter.parse_query(ft, q)
+ local query = vim.treesitter.query.parse(ft, q)
for id, node in query:iter_captures(root, 0, l, l + 1) do
local cname = query.captures[id]
if tsutils.is_in_node_range(node, l, c) then
M teal/complementree/sources.tl => teal/complementree/sources.tl +1 -1
@@ 407,7 407,7 @@ function Sources.treesitter_matches(opts: TreesitterOptions): Source
if node then
items[#items + 1] = {
- word = vim.treesitter.query.get_node_text(node, 0),
+ word = vim.treesitter.get_node_text(node, 0),
kind = kind,
icase = 1,
dup = 0,
M types/types.d.tl => types/types.d.tl +2 -2
@@ 135,10 135,10 @@ global record vim
end
record query
- get_node_text: function(TSNode, integer|nil): string
+ parse: function(string, string): TSQuery
end
- parse_query: function(string, string): TSQuery
+ get_node_text: function(TSNode, integer|nil): string
end
schedule: function(function())