Treesitter queries specified in the "inherits:" modeline are always merged, even if there is an overridden query #29348
Labels
bug
issues reporting wrong behavior
needs:discussion
issue needs attention from an expert, or PR proposes significant changes to architecture or API
treesitter
Milestone
Problem
I created
~/.config/nvim/queries/typescript/folds.scm
with the following content to override "folds" query for TypeScript:I expected to overwrite queries provided by other plugins with my query, but that is s not the case when there is "inherits:" modeline present. In
nvim-treesitter
I have installed,queries/typescript/folds.scm
is defined as follows:In this case, my query was being merged with
queries/ecma/folds.scm
. I understood this from the result ofvim.treesitter.query.get_files("typescript", "folds")
. The problem with this function is that it does not break loading queries when a non-extension query is found.neovim/runtime/lua/vim/treesitter/query.lua
Lines 115 to 162 in 61aabe0
Is this behavior intended? I believed that if "extends" modeline is not specified in the query, subsequent queries will not be loaded.
from
:help treesitter-query
:Related PR: #20117
Steps to reproduce
Output:
Expected behavior
Expected:
Neovim version (nvim -v)
NVIM v0.11.0-dev-249+g199d852d9
Vim (not Nvim) behaves the same?
no
Operating system/version
Gentoo Linux
Terminal name/version
alacritty 0.13.2
$TERM environment variable
xterm-256color
Installation
build from repo
The text was updated successfully, but these errors were encountered: