From b0fc560c758eeaa53b099c0843f82bcd762a9235 Mon Sep 17 00:00:00 2001 From: Fredrik Ekre Date: Wed, 4 Dec 2024 11:50:49 +0100 Subject: [PATCH] fix(julia): fix incorrect documentation query This patch fixes an inprecise `@string.documentation` query introduced in https://github.com/nvim-treesitter/nvim-treesitter/pull/7391. Specifically, the pattern `(string_literal) . (identifier)` matches also for example `"hello"` in ```julia foo("hello", world) @info "hello" world ``` To fix this, this patch limits the pattern to top-level statements. --- queries/julia/highlights.scm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/queries/julia/highlights.scm b/queries/julia/highlights.scm index 1d1191862..876fa72af 100644 --- a/queries/julia/highlights.scm +++ b/queries/julia/highlights.scm @@ -357,9 +357,13 @@ (module_definition) (struct_definition) (call_expression) - (identifier) ]) +(source_file + (string_literal) @string.documentation + . + (identifier)) + [ (line_comment) (block_comment)