From 3bdebfb87f115cc067f9f6a950e7ff87ac24a056 Mon Sep 17 00:00:00 2001 From: Christian Clason Date: Wed, 18 Feb 2026 12:11:15 +0100 Subject: [PATCH] feat(defaults): don't enable treesitter query linter This was added before there was a dedicated language server for tree-sitter queries. Now that https://github.com/ribru17/ts_query_ls exists, this is a better option in every regard (and up to now required manually disabling the builtin linter to avoid duplicate diagnostics and performance issues). --- runtime/doc/filetype.txt | 13 +++++++------ runtime/doc/news.txt | 2 ++ runtime/ftplugin/query.lua | 2 +- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/runtime/doc/filetype.txt b/runtime/doc/filetype.txt index 5f1471f21c..5b3dae44f4 100644 --- a/runtime/doc/filetype.txt +++ b/runtime/doc/filetype.txt @@ -901,15 +901,16 @@ QUERY *ft-query-plugin* Linting of treesitter queries for installed parsers using -|vim.treesitter.query.lint()| is enabled by default on `BufEnter` and -`BufWrite`. To change the events that trigger linting, use >lua +|vim.treesitter.query.lint()| is disabled by default. To enable +linting when opening and writing buffers, add >lua + + vim.g.query_lint_on = { 'BufEnter', 'BufWrite' } +< +to your config. To update diagnostics when editing, use >lua vim.g.query_lint_on = { 'InsertLeave', 'TextChanged' } < -To disable linting completely, set >lua - - vim.g.query_lint_on = {} -< +For a dedicated language server, see https://github.com/ribru17/ts_query_ls. QF QUICKFIX *qf.vim* *ft-qf-plugin* diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 266c10fbc8..c24f131e08 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -122,6 +122,8 @@ PLUGINS TREESITTER +• The |vim.treesitter.query.lint()| is no longer enabled by default in the + |ft-query-plugin|. • |treesitter-directive-offset!| can now be applied to quantified captures. It no longer sets `metadata[capture_id].range`; it instead sets `metadata[capture_id].offset`. The offset will be applied in diff --git a/runtime/ftplugin/query.lua b/runtime/ftplugin/query.lua index aa5cac2f07..4d9177f7ff 100644 --- a/runtime/ftplugin/query.lua +++ b/runtime/ftplugin/query.lua @@ -17,7 +17,7 @@ vim.opt_local.iskeyword:append('.') -- query linter local buf = vim.api.nvim_get_current_buf() -local query_lint_on = vim.g.query_lint_on or { 'BufEnter', 'BufWrite' } +local query_lint_on = vim.g.query_lint_on or {} if not vim.b.disable_query_linter and #query_lint_on > 0 then vim.api.nvim_create_autocmd(query_lint_on, {