From e51834fa77190006e1f95f21858a89b1e3809597 Mon Sep 17 00:00:00 2001 From: Wilfred Hughes Date: Sat, 11 May 2024 16:03:04 -0700 Subject: [PATCH] Support comment.foo highlighting queries This should improve highlighting in cases like Elm that use `@comment.elm`. --- sample_files/compare.expected | 2 +- src/parse/tree_sitter_parser.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/sample_files/compare.expected b/sample_files/compare.expected index 9a5a9caacd..6c59c357ea 100644 --- a/sample_files/compare.expected +++ b/sample_files/compare.expected @@ -257,7 +257,7 @@ sample_files/text_1.txt sample_files/text_2.txt 87914b8ef4a6b042054633ddb182ce02 - sample_files/todomvc_1.gleam sample_files/todomvc_2.gleam -070fbdea2a503392f0f0c37f1b6c04bb - +0a6f8335944adbd779c93aa52b7a30c5 - sample_files/toml_1.toml sample_files/toml_2.toml df36cf07bb1b56fbdbcea7f651b4344d - diff --git a/src/parse/tree_sitter_parser.rs b/src/parse/tree_sitter_parser.rs index 5a19b43ff5..28e21125df 100644 --- a/src/parse/tree_sitter_parser.rs +++ b/src/parse/tree_sitter_parser.rs @@ -1302,7 +1302,7 @@ fn tree_highlights( type_capture_ids.push(idx as u32); } - if name == "comment" { + if name == "comment" || name.starts_with("comment.") { comment_capture_ids.push(idx as u32); } }