neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 3bdebfb87f115cc067f9f6a950e7ff87ac24a056
parent abfe6c9ef7f4bd41c1306f3c70ead00e4afaa736
Author: Christian Clason <c.clason@uni-graz.at>
Date:   Wed, 18 Feb 2026 12:11:15 +0100

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).

Diffstat:
Mruntime/doc/filetype.txt | 11++++++-----
Mruntime/doc/news.txt | 2++
Mruntime/ftplugin/query.lua | 2+-
3 files changed, 9 insertions(+), 6 deletions(-)

diff --git 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 = { 'InsertLeave', 'TextChanged' } + vim.g.query_lint_on = { 'BufEnter', 'BufWrite' } < -To disable linting completely, set >lua +to your config. To update diagnostics when editing, use >lua - vim.g.query_lint_on = {} + vim.g.query_lint_on = { 'InsertLeave', 'TextChanged' } < +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 @@ -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 @@ -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, {