1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-02 03:12:25 +01:00

Warn when building assets from files if some referenced contexts are missing

This commit is contained in:
Keith Hall
2021-08-01 22:40:15 +03:00
parent 5f5b77cdda
commit 50e1c6074f
3 changed files with 15 additions and 6 deletions

View File

@@ -111,8 +111,17 @@ impl HighlightingAssets {
);
}
let syntax_set = syntax_set_builder.build();
let missing_contexts = syntax_set.find_unlinked_contexts();
if !missing_contexts.is_empty() {
println!("Some referenced contexts could not be found!");
for context in missing_contexts {
println!("- {}", context);
}
}
Ok(HighlightingAssets::new(
Some(syntax_set_builder.build()),
Some(syntax_set),
None,
theme_set,
))