mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-05 04:50:03 -04:00
Queries: merge query_extensions into base_language_map
These two are doing the same currently.
This commit is contained in:
parent
7b972d581c
commit
95a7d24180
1 changed files with 2 additions and 12 deletions
|
|
@ -13,12 +13,8 @@ local query_cache = caching.create_buffer_cache()
|
|||
M.base_language_map = {
|
||||
cpp = {'c'},
|
||||
typescript = {'javascript'},
|
||||
tsx = {'typescript', 'javascript'},
|
||||
}
|
||||
|
||||
M.query_extensions = {
|
||||
javascript = { 'jsx' },
|
||||
tsx = {'jsx'}
|
||||
javascript = {'jsx'},
|
||||
tsx = {'typescript', 'javascript', 'jsx'},
|
||||
}
|
||||
|
||||
M.built_in_query_groups = {'highlights', 'locals', 'textobjects', 'fold'}
|
||||
|
|
@ -84,16 +80,10 @@ end
|
|||
|
||||
local function get_query_files(lang, query_name)
|
||||
local query_files = {}
|
||||
local extensions = M.query_extensions[lang] or {}
|
||||
|
||||
local lang_files = filtered_runtime_queries(lang, query_name)
|
||||
vim.list_extend(query_files, lang_files)
|
||||
|
||||
for _, ext_lang in ipairs(extensions) do
|
||||
local ext_files = filtered_runtime_queries(ext_lang, query_name)
|
||||
vim.list_extend(query_files, ext_files)
|
||||
end
|
||||
|
||||
for _, base_lang in ipairs(M.base_language_map[lang] or {}) do
|
||||
local base_files = filtered_runtime_queries(base_lang, query_name)
|
||||
vim.list_extend(query_files, base_files)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue