From 70a10ce8bbaca032d70cfd780877775814de60c6 Mon Sep 17 00:00:00 2001 From: Simon Lasbrugnas Date: Mon, 10 Nov 2025 14:46:40 +0100 Subject: [PATCH] chore: update treesitter config and drop lsp semantic tokens --- lazy-lock.json | 2 +- lua/config/autocmds.lua | 10 ++++++ lua/custom/plugins/nvim-treesitter.lua | 45 ++------------------------ 3 files changed, 13 insertions(+), 44 deletions(-) diff --git a/lazy-lock.json b/lazy-lock.json index f147dfa..5a744df 100644 --- a/lazy-lock.json +++ b/lazy-lock.json @@ -48,7 +48,7 @@ "nvim-lint": { "branch": "master", "commit": "8b349e822a36e9480aed96c6dd2f757f80524a35" }, "nvim-lspconfig": { "branch": "master", "commit": "2010fc6ec03e2da552b4886fceb2f7bc0fc2e9c0" }, "nvim-nio": { "branch": "master", "commit": "21f5324bfac14e22ba26553caf69ec76ae8a7662" }, - "nvim-treesitter": { "branch": "main", "commit": "81aec1e45d58b587fa055a938cd6642c6b94ba4d" }, + "nvim-treesitter": { "branch": "master", "commit": "42fc28ba918343ebfd5565147a42a26580579482" }, "nvim-treesitter-context": { "branch": "master", "commit": "660861b1849256398f70450afdf93908d28dc945" }, "nvim-ts-autotag": { "branch": "main", "commit": "c4ca798ab95b316a768d51eaaaee48f64a4a46bc" }, "nvim-web-devicons": { "branch": "master", "commit": "8dcb311b0c92d460fac00eac706abd43d94d68af" }, diff --git a/lua/config/autocmds.lua b/lua/config/autocmds.lua index f1006bf..aded3cb 100644 --- a/lua/config/autocmds.lua +++ b/lua/config/autocmds.lua @@ -23,6 +23,16 @@ vim.api.nvim_create_autocmd("FileType", { end, }) +-- Disable LSP Semantic Tokens +vim.api.nvim_create_autocmd("LspAttach", { + callback = function(args) + local client = vim.lsp.get_client_by_id(args.data.client_id) + if client and client.server_capabilities.semanticTokensProvider then + client.server_capabilities.semanticTokensProvider = nil + end + end, +}) + -- Auto insert mode on TermOpen vim.api.nvim_create_autocmd({ "TermOpen", "BufEnter" }, { pattern = { "*" }, diff --git a/lua/custom/plugins/nvim-treesitter.lua b/lua/custom/plugins/nvim-treesitter.lua index 97db976..c992751 100644 --- a/lua/custom/plugins/nvim-treesitter.lua +++ b/lua/custom/plugins/nvim-treesitter.lua @@ -1,47 +1,6 @@ return { - { - "nvim-treesitter/nvim-treesitter", - branch = "main", - lazy = false, - build = ":TSUpdate", - config = function() - require("nvim-treesitter").setup({ - indent = { enable = true }, - highlight = { enable = true }, - ensure_installed = { - "bash", - "c", - "diff", - "html", - "javascript", - "jsx", - "jsdoc", - "json", - "jsonc", - "lua", - "luadoc", - "luap", - "markdown", - "markdown_inline", - "printf", - "python", - "query", - "regex", - "toml", - "tsx", - "typescript", - "vim", - "vimdoc", - "xml", - "yaml", - "go", - "gomod", - "gosum", - }, - }) - end, - }, - + -- Treesitter + { "nvim-treesitter/nvim-treesitter", branch = 'master', lazy = false, build = ":TSUpdate" }, -- Show context of the current function { "nvim-treesitter/nvim-treesitter-context",