BREAKING CHANGE: Migrate to nvim-treesitter main branch #3295
Users must now use the :TSInstallAll command to install all treesitter parsers defined in their config. So there's no automatic downloading of treesitter parsers like before tree-sitter-cli is a required dependency now --------- Co-authored-by: siduck <siduck@tutanota.com>
This commit is contained in:
co-authored by
siduck
parent
30e75dbbdf
commit
6a0715d3f3
@@ -25,3 +25,18 @@ autocmd({ "UIEnter", "BufReadPost", "BufNewFile" }, {
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_autocmd("FileType", {
|
||||
pattern = "*",
|
||||
callback = function()
|
||||
pcall(vim.treesitter.start)
|
||||
end,
|
||||
})
|
||||
|
||||
local create_cmd = vim.api.nvim_create_user_command
|
||||
|
||||
create_cmd("TSInstallAll", function()
|
||||
local spec = require("lazy.core.config").plugins["nvim-treesitter"]
|
||||
local opts = type(spec.opts) == "table" and spec.opts or {}
|
||||
require("nvim-treesitter").install(opts.ensure_installed)
|
||||
end, {})
|
||||
|
||||
Reference in New Issue
Block a user