Skip to content

Commit

Permalink
languages: Enable grammar loading when compiling with test feature (#…
Browse files Browse the repository at this point in the history
…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 <thorsten@zed.dev>

Release Notes:

- N/A

Co-authored-by: Thorsten <thorsten@zed.dev>
  • Loading branch information
bennetbo and Thorsten authored Oct 29, 2024
1 parent bdb54de commit 7a6b643
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/languages/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 7a6b643

Please sign in to comment.