mirror of
https://github.com/sharkdp/bat
synced 2026-08-03 18:51:44 +00:00
Warn when building assets from files if some referenced contexts are missing
This commit is contained in:
+10
-1
@@ -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