sublime_syntaxes/lib.rs
1#![doc = include_str!("../README.md")]
2
3use syntect::parsing::SyntaxSet;
4
5const SYNTAX_SET_BINARY: &[u8] = include_bytes!(concat!(env!("OUT_DIR"), "/syntaxes.bin"));
6
7/// Returns the precompiled [`SyntaxSet`] containing extra syntax definitions
8/// not included in syntect's defaults (e.g. TOML).
9///
10/// The syntax set is deserialized from a binary blob that was compiled at build
11/// time, so this is cheaper than parsing YAML definitions at runtime.
12pub fn extra_syntax_set() -> SyntaxSet {
13 syntect::dumps::from_binary(SYNTAX_SET_BINARY)
14}