Skip to content

Commit 6696621

Browse files
committed
fix: update treesitter functions
1 parent aa084b5 commit 6696621

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

lua/orgmode/colors/markup_highlighter.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ local function load_deps()
226226
if query then
227227
return
228228
end
229-
query = vim.treesitter.get_query('org', 'markup')
229+
query = vim.treesitter.query.get('org', 'markup')
230230
vim.treesitter.query.add_predicate('org-is-valid-markup-range?', is_valid_markup_range)
231231
vim.treesitter.query.add_predicate('org-is-valid-hyperlink-range?', is_valid_hyperlink_range)
232232
vim.treesitter.query.add_predicate('org-is-valid-latex-range?', is_valid_latex_range)

lua/orgmode/colors/todo_highlighter.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ local tree_utils = require('orgmode.utils.treesitter')
44
local utils = require('orgmode.utils')
55

66
local function add_todo_keyword_highlights()
7-
local query_files = vim.treesitter.get_query_files('org', 'highlights')
7+
local query_files = vim.treesitter.query.get_files('org', 'highlights')
88
if not query_files or #query_files == 0 then
99
return
1010
end
@@ -51,7 +51,7 @@ local function add_todo_keyword_highlights()
5151
for _, v in ipairs(lines) do
5252
table.insert(all_lines, v)
5353
end
54-
vim.treesitter.set_query('org', 'highlights', table.concat(all_lines, '\n'))
54+
vim.treesitter.query.set('org', 'highlights', table.concat(all_lines, '\n'))
5555
if vim.bo.filetype == 'org' then
5656
tree_utils.restart_highlights()
5757
end

lua/orgmode/org/indent.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ end)
6767

6868
local prev_section = nil
6969
local function foldexpr()
70-
query = query or vim.treesitter.get_query('org', 'org_indent')
70+
query = query or vim.treesitter.query.get('org', 'org_indent')
7171
local matches = get_matches(0)
7272
local match = matches[vim.v.lnum]
7373
local next_match = matches[vim.v.lnum + 1]
@@ -114,7 +114,7 @@ end
114114

115115
local function indentexpr()
116116
local noindent_mode = config.org_indent_mode == 'noindent'
117-
query = query or vim.treesitter.get_query('org', 'org_indent')
117+
query = query or vim.treesitter.query.get('org', 'org_indent')
118118

119119
local prev_linenr = vim.fn.prevnonblank(vim.v.lnum - 1)
120120

lua/orgmode/utils/init.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ function utils.get_ts_matches(query, node, file_content, file_content_str)
234234
local matches = {}
235235
local ts_query = query_cache[query]
236236
if not ts_query then
237-
ts_query = ts.parse_query('org', query)
237+
ts_query = ts.parse('org', query)
238238
query_cache[query] = ts_query
239239
end
240240
for _, match, _ in ts_query:iter_matches(node, file_content_str) do

lua/orgmode/utils/treesitter.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ end
2121
function M.parse_query(query)
2222
local ts_query = query_cache[query]
2323
if not ts_query then
24-
ts_query = vim.treesitter.query.parse_query('org', query)
24+
ts_query = vim.treesitter.query.parse('org', query)
2525
query_cache[query] = ts_query
2626
end
2727
return query_cache[query]

0 commit comments

Comments
 (0)