mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
fix(treesitter): use the right loading order for base queries (#20117)
Use the first, not last, query for a language on runtimepath. Typically, this implies that a user query will override a site plugin query, which will override a bundled runtime query.
This commit is contained in:
parent
0405594399
commit
893b659e88
@ -187,6 +187,11 @@ Note: The predicates listed in the web page above differ from those Neovim
|
|||||||
supports. See |lua-treesitter-predicates| for a complete list of predicates
|
supports. See |lua-treesitter-predicates| for a complete list of predicates
|
||||||
supported by Neovim.
|
supported by Neovim.
|
||||||
|
|
||||||
|
By default, the first query on `runtimepath` is used (which usually implies
|
||||||
|
that user config takes precedence over plugins, which take precedence over
|
||||||
|
queries bundled with Neovim). If a query should extend other queries instead
|
||||||
|
of replacing them, use the `; extends` modeline below.
|
||||||
|
|
||||||
A `query` consists of one or more patterns. A `pattern` is defined over node
|
A `query` consists of one or more patterns. A `pattern` is defined over node
|
||||||
types in the syntax tree. A `match` corresponds to specific elements of the
|
types in the syntax tree. A `match` corresponds to specific elements of the
|
||||||
syntax tree which match a pattern. Patterns may optionally define captures
|
syntax tree which match a pattern. Patterns may optionally define captures
|
||||||
|
@ -97,7 +97,7 @@ function M.get_query_files(lang, query_name, is_included)
|
|||||||
|
|
||||||
if extension then
|
if extension then
|
||||||
table.insert(extensions, filename)
|
table.insert(extensions, filename)
|
||||||
else
|
elseif base_query == nil then
|
||||||
base_query = filename
|
base_query = filename
|
||||||
end
|
end
|
||||||
io.close(file)
|
io.close(file)
|
||||||
|
Loading…
Reference in New Issue
Block a user