From 9e1a2a701b9e8a4902622b06eafc1720a7652836 Mon Sep 17 00:00:00 2001 From: Amaan Qureshi Date: Sun, 15 Dec 2024 22:37:03 -0500 Subject: [PATCH] fix(cli): correct default query paths --- cli/loader/Cargo.toml | 2 -- cli/loader/src/lib.rs | 12 +++++------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/cli/loader/Cargo.toml b/cli/loader/Cargo.toml index 845070d9..5e524b04 100644 --- a/cli/loader/Cargo.toml +++ b/cli/loader/Cargo.toml @@ -21,8 +21,6 @@ workspace = true [features] wasm = ["tree-sitter/wasm"] -# TODO: For backward compatibility these must be enabled by default, -# consider removing for the next semver incompatible release default = ["tree-sitter-highlight", "tree-sitter-tags"] [dependencies] diff --git a/cli/loader/src/lib.rs b/cli/loader/src/lib.rs index acd4f370..4c484892 100644 --- a/cli/loader/src/lib.rs +++ b/cli/loader/src/lib.rs @@ -1385,14 +1385,14 @@ impl LanguageConfiguration<'_> { Some( paths .iter() - .filter(|p| p.ends_with("tree-sitter-highlights.scm")) + .filter(|p| p.ends_with("highlights.scm")) .cloned() .collect::>(), ), Some( paths .iter() - .filter(|p| p.ends_with("tree-sitter-tags.scm")) + .filter(|p| p.ends_with("tags.scm")) .cloned() .collect::>(), ), @@ -1414,7 +1414,7 @@ impl LanguageConfiguration<'_> { } else { self.highlights_filenames.as_deref() }, - "tree-sitter-highlights.scm", + "highlights.scm", )?; let (injections_query, injection_ranges) = self.read_queries( if injections_filenames.is_some() { @@ -1491,7 +1491,7 @@ impl LanguageConfiguration<'_> { self.tags_config .get_or_try_init(|| { let (tags_query, tags_ranges) = - self.read_queries(self.tags_filenames.as_deref(), "tree-sitter-tags.scm")?; + self.read_queries(self.tags_filenames.as_deref(), "tags.scm")?; let (locals_query, locals_ranges) = self.read_queries(self.locals_filenames.as_deref(), "locals.scm")?; if tags_query.is_empty() { @@ -1563,9 +1563,7 @@ impl LanguageConfiguration<'_> { } } else { // highlights.scm is needed to test highlights, and tags.scm to test tags - if default_path == "tree-sitter-highlights.scm" - || default_path == "tree-sitter-tags.scm" - { + if default_path == "highlights.scm" || default_path == "tags.scm" { eprintln!( indoc! {" Warning: you should add a `{}` entry pointing to the highlights path in the `tree-sitter` object in the grammar's tree-sitter.json file.