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

Merge pull request #1771 from sharkdp/warn_when_missing_contexts

Warn when building assets from files if some referenced contexts are missing
This commit is contained in:
Keith Hall
2021-08-02 22:55:37 +03:00
committed by GitHub
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,
))