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:
@@ -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,
|
||||
))
|
||||
|
Reference in New Issue
Block a user