diff options
| author | Thomas Vigouroux <tomvig38@gmail.com> | 2020-10-06 20:03:39 +0200 |
|---|---|---|
| committer | Thomas Vigouroux <tomvig38@gmail.com> | 2020-10-11 19:09:22 +0200 |
| commit | c055899dc0739fb48541365dfffda852034438c2 (patch) | |
| tree | 0ce2d6fa0cb09551ca204ebb62e6a6a609ef08b2 /CONTRIBUTING.md | |
| parent | Use utils get_node_text to get line content and trim all whitespaces. (diff) | |
| download | nvim-treesitter-c055899dc0739fb48541365dfffda852034438c2.tar nvim-treesitter-c055899dc0739fb48541365dfffda852034438c2.tar.gz nvim-treesitter-c055899dc0739fb48541365dfffda852034438c2.tar.bz2 nvim-treesitter-c055899dc0739fb48541365dfffda852034438c2.tar.lz nvim-treesitter-c055899dc0739fb48541365dfffda852034438c2.tar.xz nvim-treesitter-c055899dc0739fb48541365dfffda852034438c2.tar.zst nvim-treesitter-c055899dc0739fb48541365dfffda852034438c2.zip | |
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.
Diffstat (limited to 'CONTRIBUTING.md')
| -rw-r--r-- | CONTRIBUTING.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9006308db..09ef589f8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. |
