From 429e6f446b7f2e3201fa940b897414db73047634 Mon Sep 17 00:00:00 2001 From: Phạm Huy Hoàng Date: Tue, 27 Feb 2024 01:00:55 +0900 Subject: doc: better clarification of highlights/injections --- CONTRIBUTING.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'CONTRIBUTING.md') diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b7ecb5690..55c0bc284 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -72,7 +72,8 @@ For these types there is a _norm_ you will have to follow so that features work Here are some global advices: - Examples of queries can be found in [runtime/queries/](runtime/queries/) -- Note that (unlike tree-sitter) all matching patterns are applied, with the last one determining the visible highlight. +- For highlights, all matching patterns are applied, with the last one determining the visible capture & highlight. +- For injections, try your best to ensure that each captured node is only matched by a single pattern. - If the [parser is included in `nvim-treesitter`](https://github.com/nvim-treesitter/nvim-treesitter/SUPPORTED_LANGUAGES.md`) and installed with `:TSInstall`, you can use Neovim's developer tools (`:checkhealth`, `:InspectTree`, `:EditQuery`, `:Inspect`) to test your queries. #### Inheriting languages -- cgit v1.2.3-70-g09d2