fix: use legacy nvim-treesitter config API and correct mason package name

This commit is contained in:
Maxime Pierront 2026-02-14 10:35:38 +01:00
parent e79572c9e6
commit 25108a2d2e
1 changed files with 9 additions and 7 deletions

View File

@ -614,7 +614,7 @@ require('lazy').setup({
-- You can press `g?` for help in this menu. -- You can press `g?` for help in this menu.
local ensure_installed = vim.tbl_keys(servers or {}) local ensure_installed = vim.tbl_keys(servers or {})
vim.list_extend(ensure_installed, { vim.list_extend(ensure_installed, {
'lua_ls', -- Lua Language server 'lua-language-server', -- Lua Language server
'stylua', -- Used to format Lua code 'stylua', -- Used to format Lua code
-- You can add other tools here that you want Mason to install -- You can add other tools here that you want Mason to install
}) })
@ -851,13 +851,15 @@ require('lazy').setup({
{ -- Highlight, edit, and navigate code { -- Highlight, edit, and navigate code
'nvim-treesitter/nvim-treesitter', 'nvim-treesitter/nvim-treesitter',
build = ':TSUpdate',
config = function() config = function()
local filetypes = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' } ---@diagnostic disable-next-line: missing-fields
require('nvim-treesitter').install(filetypes) require('nvim-treesitter.configs').setup {
vim.api.nvim_create_autocmd('FileType', { ensure_installed = { 'bash', 'c', 'diff', 'html', 'lua', 'luadoc', 'markdown', 'markdown_inline', 'query', 'vim', 'vimdoc' },
pattern = filetypes, auto_install = true,
callback = function() vim.treesitter.start() end, highlight = { enable = true },
}) indent = { enable = true },
}
end, end,
}, },