1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-08 14:22:25 +01:00

Add code for analyzing dependencies between syntaxes

And also to generate independent SyntaxSets. This will later be used
to improve bat startup time.
This commit is contained in:
Martin Nordholts
2021-08-01 19:08:57 +02:00
parent bd797c75a4
commit 47d955a2ab
3 changed files with 191 additions and 0 deletions

View File

@@ -111,6 +111,12 @@ impl HighlightingAssets {
);
}
if std::env::var("BAT_PRINT_SYNTAX_DEPENDENCIES").is_ok() {
// To trigger this code, run:
// BAT_PRINT_SYNTAX_DEPENDENCIES=1 cargo run -- cache --build --source assets --blank --target /tmp
crate::syntax_dependencies::print_syntax_dependencies(&syntax_set_builder);
}
let syntax_set = syntax_set_builder.build();
let missing_contexts = syntax_set.find_unlinked_contexts();
if !missing_contexts.is_empty() {