mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-10 23:40:04 -04:00
fix: shim 0.9 deprecations
This commit is contained in:
parent
c7b9f68d03
commit
90ead4ed58
6 changed files with 27 additions and 8 deletions
|
|
@ -6,6 +6,7 @@ local info = require "nvim-treesitter.info"
|
|||
local shell = require "nvim-treesitter.shell_command_selectors"
|
||||
local install = require "nvim-treesitter.install"
|
||||
local utils = require "nvim-treesitter.utils"
|
||||
local ts = require "nvim-treesitter.compat"
|
||||
|
||||
local health = vim.health or require "health"
|
||||
|
||||
|
|
@ -147,13 +148,13 @@ function M.check()
|
|||
local lang, type, err = unpack(p)
|
||||
local lines = {}
|
||||
table.insert(lines, lang .. "(" .. type .. "): " .. err)
|
||||
local files = vim.treesitter.query.get_query_files(lang, type)
|
||||
local files = ts.get_query_files(lang, type)
|
||||
if #files > 0 then
|
||||
table.insert(lines, lang .. "(" .. type .. ") is concatenated from the following files:")
|
||||
for _, file in ipairs(files) do
|
||||
local fd = io.open(file, "r")
|
||||
if fd then
|
||||
local ok, file_err = pcall(vim.treesitter.query.parse_query, lang, fd:read "*a")
|
||||
local ok, file_err = pcall(ts.parse_query, lang, fd:read "*a")
|
||||
if ok then
|
||||
table.insert(lines, '| [OK]:"' .. file .. '"')
|
||||
else
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue