mirror of
				https://github.com/sharkdp/bat.git
				synced 2025-10-31 07:04:04 +00: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:
		
							
								
								
									
										8
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										8
									
								
								Cargo.lock
									
									
									
										generated
									
									
									
								
							| @@ -393,9 +393,9 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "fancy-regex" | ||||
| version = "0.3.5" | ||||
| version = "0.7.1" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "ae91abf6555234338687bb47913978d275539235fcb77ba9863b779090b42b14" | ||||
| checksum = "9d6b8560a05112eb52f04b00e5d3790c0dd75d9d980eb8a122fb23b92a623ccf" | ||||
| dependencies = [ | ||||
|  "bit-set", | ||||
|  "regex", | ||||
| @@ -1120,9 +1120,9 @@ dependencies = [ | ||||
|  | ||||
| [[package]] | ||||
| name = "syntect" | ||||
| version = "4.5.0" | ||||
| version = "4.6.0" | ||||
| source = "registry+https://github.com/rust-lang/crates.io-index" | ||||
| checksum = "2bfac2b23b4d049dc9a89353b4e06bbc85a8f42020cccbe5409a115cf19031e5" | ||||
| checksum = "8b20815bbe80ee0be06e6957450a841185fcf690fe0178f14d77a05ce2caa031" | ||||
| dependencies = [ | ||||
|  "bincode", | ||||
|  "bitflags", | ||||
|   | ||||
| @@ -60,7 +60,7 @@ optional = true | ||||
| default-features = false | ||||
|  | ||||
| [dependencies.syntect] | ||||
| version = "4.5.0" | ||||
| version = "4.6.0" | ||||
| default-features = false | ||||
| features = ["parsing", "yaml-load", "dump-load", "dump-create"] | ||||
|  | ||||
|   | ||||
| @@ -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