mirror of
https://github.com/itme-brain/nvim.git
synced 2026-05-08 07:00:13 -04:00
fix(treesitter): migrate to main api
This commit is contained in:
parent
376b9c5c16
commit
6176457340
2 changed files with 6 additions and 5 deletions
|
|
@ -76,7 +76,8 @@ return {
|
|||
})
|
||||
end,
|
||||
config = function()
|
||||
require("nvim-treesitter").setup()
|
||||
local treesitter = require("nvim-treesitter")
|
||||
treesitter.setup()
|
||||
|
||||
local function has_c_compiler()
|
||||
return vim.fn.executable("cc") == 1
|
||||
|
|
@ -93,7 +94,7 @@ return {
|
|||
return
|
||||
end
|
||||
|
||||
require("nvim-treesitter.install").ensure_installed(missing)
|
||||
treesitter.install(missing)
|
||||
end
|
||||
|
||||
local function tree_sitter_cli_works()
|
||||
|
|
@ -170,14 +171,14 @@ return {
|
|||
end)
|
||||
end
|
||||
|
||||
local installed = require("nvim-treesitter.info").installed_parsers()
|
||||
local installed = treesitter.get_installed("parsers")
|
||||
local missing = vim.iter(treesitter_parsers)
|
||||
:filter(function(parser)
|
||||
return not vim.tbl_contains(installed, parser)
|
||||
end)
|
||||
:totable()
|
||||
|
||||
if #missing == 0 and #vim.api.nvim_list_uis() == 0 then
|
||||
if #missing == 0 then
|
||||
return
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue