mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
feat(queries): modeline mechanism for base langs
This implements https://github.com/neovim/neovim/pull/13059#issuecomment-704414189 This behaves like modelines and remove the use of the base_language map. Also, this allows to fine-tune what we actually want to include per query, which is better IMO.
This commit is contained in:
parent
9ad47c65bd
commit
c055899dc0
17 changed files with 73 additions and 32 deletions
|
|
@ -67,6 +67,18 @@ Here are some global advices :
|
|||
- Examples of queries can be found in [queries/](queries/)
|
||||
- Matches in the bottom will override queries that are above of them.
|
||||
|
||||
If your language is an extension of a language (TypeScript is an extension of JavaScript for
|
||||
example), you can include the queries from your base language by adding the following _as the first
|
||||
line of your file_.
|
||||
|
||||
```scheme
|
||||
; inherits: lang1,(optionallang)
|
||||
```
|
||||
|
||||
If you want to include a language for a given query, but don't want for the queries including the
|
||||
query you qre writing to include it too, you can mark the language as optional (by putting it
|
||||
between parenthesis).
|
||||
|
||||
### Highlights
|
||||
|
||||
As languages differ quite a lot, here is a set of captures available to you when building a `highlights.scm` query.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue