From 7a6b6435c48024948b01d8f25d17c249f77ad522 Mon Sep 17 00:00:00 2001 From: Bennet Bo Fenner Date: Tue, 29 Oct 2024 11:00:44 +0100 Subject: [PATCH] languages: Enable grammar loading when compiling with test feature (#19881) This ensures that `cargo tests -p languages` will not fail with a confusing error message. Follow up to #19821 We opted to check the `test` feature flag instead of defining a runtime flag, because we only want to include the `tree-sitter-*` dependencies in some cases, which is not possible with a runtime flag. Co-Authored-by: Thorsten Release Notes: - N/A Co-authored-by: Thorsten --- crates/languages/src/lib.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/languages/src/lib.rs b/crates/languages/src/lib.rs index 2fd8ffa633..455b05b64c 100644 --- a/crates/languages/src/lib.rs +++ b/crates/languages/src/lib.rs @@ -325,7 +325,7 @@ fn load_config(name: &str) -> LanguageConfig { .with_context(|| format!("failed to load config.toml for language {name:?}")) .unwrap(); - #[cfg(not(feature = "load-grammars"))] + #[cfg(not(any(feature = "load-grammars", test)))] { config = LanguageConfig { name: config.name,