mirror of
https://github.com/neovim/neovim.git
synced 2026-04-21 06:45:37 +00:00
fix(treesitter): ":EditQuery [lang]" with injected languages #34914
Problem: `:EditQuery` command accepts a language argument, but it doesn't highlight properly for injected languages. Solution: - Fully parse with the root language and then filter the query on the child trees that are of the language requested. - Also support completion (`EditQuery <tab>`).
This commit is contained in:
@@ -23,7 +23,13 @@ do
|
||||
|
||||
vim.api.nvim_create_user_command('EditQuery', function(cmd)
|
||||
vim.treesitter.query.edit(cmd.fargs[1])
|
||||
end, { desc = 'Edit treesitter query', nargs = '?' })
|
||||
end, {
|
||||
desc = 'Edit treesitter query',
|
||||
nargs = '?',
|
||||
complete = function()
|
||||
return vim.treesitter.language._complete()
|
||||
end,
|
||||
})
|
||||
|
||||
vim.api.nvim_create_user_command('Open', function(cmd)
|
||||
vim.ui.open(assert(cmd.fargs[1]))
|
||||
|
||||
Reference in New Issue
Block a user