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
|
|
@ -12,7 +12,7 @@
|
|||
"mason.nvim": { "branch": "main", "commit": "cb8445f8ce85d957416c106b780efd51c6298f89" },
|
||||
"nvim-dap": { "branch": "master", "commit": "45a69eba683a2c448dd9ecfc4de89511f0646b5f" },
|
||||
"nvim-lspconfig": { "branch": "master", "commit": "31026a13eefb20681124706a79fc1df6bf11ab27" },
|
||||
"nvim-treesitter": { "branch": "master", "commit": "cf12346a3414fa1b06af75c79faebe7f76df080a" },
|
||||
"nvim-treesitter": { "branch": "main", "commit": "4916d6592ede8c07973490d9322f187e07dfefac" },
|
||||
"nvim-web-devicons": { "branch": "master", "commit": "4fc505ac7bd7692824a142e96e5f529c133862f8" },
|
||||
"oil.nvim": { "branch": "master", "commit": "0fcc83805ad11cf714a949c98c605ed717e0b83e" },
|
||||
"pi.nvim": { "branch": "main", "commit": "6e86a704ed6ff488fda78b64f4e564d6ee620785" },
|
||||
|
|
|
|||
|
|
@ -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