File tree Expand file tree Collapse file tree 2 files changed +4
-7
lines changed
nvim-treesitter/textobjects Expand file tree Collapse file tree 2 files changed +4
-7
lines changed Original file line number Diff line number Diff line change 11local configs = require " nvim-treesitter.configs"
22local utils = require " nvim-treesitter.utils"
3+ local ts = require " nvim-treesitter.compat"
34
45local M = {}
56
67M .has_textobjects = function (lang )
7- if vim .treesitter .query .get_files then
8- return vim .treesitter .query .get_files (lang , " textobjects" ) ~= nil
9- else
10- -- deprecated since nvim 0.9
11- return vim .treesitter .query .get_query_files (lang , " textobjects" ) ~= nil
12- end
8+ return ts .get_query_files (lang , " textobjects" ) ~= nil
139end
1410
1511local function has_some_textobject_mapping (lang )
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ local api = vim.api
33local parsers = require " nvim-treesitter.parsers"
44local queries = require " nvim-treesitter.query"
55local ts_utils = require " nvim-treesitter.ts_utils"
6+ local ts = require " nvim-treesitter.compat"
67
78local M = {}
89
9596function M .available_textobjects (lang , query_group )
9697 lang = lang or parsers .get_buf_lang ()
9798 query_group = query_group or " textobjects"
98- local parsed_queries = queries .get_query (lang , query_group )
99+ local parsed_queries = ts .get_query (lang , query_group )
99100 if not parsed_queries then
100101 return {}
101102 end
You can’t perform that action at this time.
0 commit comments