aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFredrik Ekre <ekrefredrik@gmail.com>2024-11-22 16:51:33 +0100
committerChristian Clason <ch.clason+github@icloud.com>2024-11-23 10:40:13 +0100
commite05c280659b539d4cfeed11c5f9f45f784a8d4f5 (patch)
tree1bc94a700b879307d566533c091e87a3bc1dac1c
parentfix(julia): fix macro identifier highlight query (diff)
downloadnvim-treesitter-e05c280659b539d4cfeed11c5f9f45f784a8d4f5.tar
nvim-treesitter-e05c280659b539d4cfeed11c5f9f45f784a8d4f5.tar.gz
nvim-treesitter-e05c280659b539d4cfeed11c5f9f45f784a8d4f5.tar.bz2
nvim-treesitter-e05c280659b539d4cfeed11c5f9f45f784a8d4f5.tar.lz
nvim-treesitter-e05c280659b539d4cfeed11c5f9f45f784a8d4f5.tar.xz
nvim-treesitter-e05c280659b539d4cfeed11c5f9f45f784a8d4f5.tar.zst
nvim-treesitter-e05c280659b539d4cfeed11c5f9f45f784a8d4f5.zip
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)`.
-rw-r--r--queries/julia/highlights.scm11
1 files changed, 10 insertions, 1 deletions
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