From e05c280659b539d4cfeed11c5f9f45f784a8d4f5 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Fri, 22 Nov 2024 16:51:33 +0100 Subject: fix(julia): misc fixes to type highlighting This patch fixes two issues related to `@type` capturing (split out from https://github.com/nvim-treesitter/nvim-treesitter/pull/7392): - Capture the RHS of `<:` and `>:` as `@type` in `(unary_expression)`s similarly to what is already done for `(binary_expression)`s with these operators. - Capture children of `(curly_expression)`s inside of `(where_expression)`s as `@type` similarly how they are handled in `(parametrized_type_expression)`. --- queries/julia/highlights.scm | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/queries/julia/highlights.scm b/queries/julia/highlights.scm index 1b096c05d..6988e69f5 100644 --- a/queries/julia/highlights.scm +++ b/queries/julia/highlights.scm @@ -73,7 +73,16 @@ (identifier) @type .) (where_expression - (_) @type .) + [ + (curly_expression + (_) @type) + (_) @type + ] .) + +(unary_expression + (operator) @operator + (_) @type + (#any-of? @operator "<:" ">:")) (binary_expression (_) @type -- cgit v1.2.3-70-g09d2