diff options
| -rw-r--r-- | queries/julia/highlights.scm | 8 | ||||
| -rw-r--r-- | tests/query/highlights/julia/test.jl | 6 |
2 files changed, 11 insertions, 3 deletions
diff --git a/queries/julia/highlights.scm b/queries/julia/highlights.scm index 6988e69f5..789f8190c 100644 --- a/queries/julia/highlights.scm +++ b/queries/julia/highlights.scm @@ -281,6 +281,14 @@ "::" ] @punctuation.delimiter +; Treat `::` as operator in type contexts, see +; https://github.com/nvim-treesitter/nvim-treesitter/pull/7392 +(typed_expression + "::" @operator) + +(unary_typed_expression + "::" @operator) + [ "(" ")" diff --git a/tests/query/highlights/julia/test.jl b/tests/query/highlights/julia/test.jl index 445efaa1f..338b7f8a1 100644 --- a/tests/query/highlights/julia/test.jl +++ b/tests/query/highlights/julia/test.jl @@ -2,13 +2,13 @@ function load_data(::Symbol; ::Int) :: Tuple # <- @keyword.function # ^ @function.call # ^ @punctuation.bracket -# ^^ @punctuation.delimiter +# ^^ @operator # ^ @type.builtin # ^ @punctuation.delimiter -# ^^ @punctuation.delimiter +# ^^ @operator # ^^^ @type.builtin # ^ @punctuation.bracket -# ^^ @punctuation.delimiter +# ^^ @operator # ^ @type.builtin dataset = CIFAR10(; Tx = Float32, split = split) # ^^^^^^^ @variable |
