fix(treesitter): use configs.setup and drop extra install logic

This commit is contained in:
Test 2026-02-11 05:25:24 +09:00 committed by Paul B. Kim
parent ba5ecb2e1f
commit 1c56f4cdc0
No known key found for this signature in database
1 changed files with 1 additions and 15 deletions

View File

@ -754,7 +754,6 @@ require('lazy').setup({
bashls = {}, bashls = {},
awk_ls = {}, awk_ls = {},
cssls = {}, cssls = {},
htmx = {},
html = {}, html = {},
jsonls = {}, jsonls = {},
yamlls = {}, yamlls = {},
@ -1045,20 +1044,7 @@ require('lazy').setup({
auto_install = true, auto_install = true,
}, },
config = function(_, opts) config = function(_, opts)
local ts = require 'nvim-treesitter' require('nvim-treesitter.configs').setup(opts)
ts.setup()
-- Install only parsers that are not already present to avoid repeated startup spam.
if opts.auto_install and opts.ensure_installed and #opts.ensure_installed > 0 then
local installed = ts.get_installed 'parsers'
local missing = vim.tbl_filter(function(lang)
return not vim.list_contains(installed, lang)
end, opts.ensure_installed)
if #missing > 0 then
ts.install(missing)
end
end
vim.api.nvim_create_autocmd('FileType', { vim.api.nvim_create_autocmd('FileType', {
group = vim.api.nvim_create_augroup('kickstart-treesitter', { clear = true }), group = vim.api.nvim_create_augroup('kickstart-treesitter', { clear = true }),