Fix treesitter config module name for current nvim-treesitter
This commit is contained in:
@@ -3,9 +3,21 @@
|
|||||||
return {
|
return {
|
||||||
"nvim-treesitter/nvim-treesitter",
|
"nvim-treesitter/nvim-treesitter",
|
||||||
build = ":TSUpdate", -- Installs and updates parsers
|
build = ":TSUpdate", -- Installs and updates parsers
|
||||||
|
|
||||||
config = function()
|
config = function()
|
||||||
require("nvim-treesitter.configs").setup({
|
local ok, ts = pcall(require, "nvim-treesitter.config")
|
||||||
-- A list of parser names, or "all"
|
if not ok then
|
||||||
|
ok, ts = pcall(require, "nvim-treesitter.configs")
|
||||||
|
end
|
||||||
|
if not ok then
|
||||||
|
vim.notify(
|
||||||
|
"nvim-treesitter: config module not found",
|
||||||
|
vim.log.levels.ERROR
|
||||||
|
)
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
ts.setup({
|
||||||
ensure_installed = {
|
ensure_installed = {
|
||||||
"c",
|
"c",
|
||||||
"cpp",
|
"cpp",
|
||||||
@@ -21,16 +33,10 @@ return {
|
|||||||
"json",
|
"json",
|
||||||
"php",
|
"php",
|
||||||
},
|
},
|
||||||
|
|
||||||
-- Install parsers synchronously (only applied on startup)
|
|
||||||
sync_install = false,
|
sync_install = false,
|
||||||
|
|
||||||
-- Automatically install missing parsers when entering buffer
|
|
||||||
auto_install = true,
|
auto_install = true,
|
||||||
|
highlight = { enable = true },
|
||||||
highlight = {
|
|
||||||
enable = true,
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
end,
|
end,
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user