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:
Peter Cardenas
2025-07-19 11:36:51 -07:00
committed by GitHub
parent c5167ffc18
commit e5c2ce5905
5 changed files with 48 additions and 16 deletions

View File

@@ -1165,6 +1165,8 @@ end
---
--- Can also be shown with `:EditQuery`. [:EditQuery]()
---
--- `:EditQuery <tab>` completes the treesitter parser names in the runtime path.
---
--- If you move the cursor to a capture name ("@foo"), text matching the capture is highlighted in
--- the source buffer. The query editor is a scratch buffer, use `:write` to save it. You can find
--- example queries at `$VIMRUNTIME/queries/`.