diff --git a/Cargo.toml b/Cargo.toml index 9ee5bf8..6522cb8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -13,6 +13,7 @@ include = [ "bindings/rust/*", "grammar.js", "src/*", + "queries/*", ] [lib] diff --git a/bindings/rust/lib.rs b/bindings/rust/lib.rs index 796e756..b70d8f5 100644 --- a/bindings/rust/lib.rs +++ b/bindings/rust/lib.rs @@ -34,6 +34,9 @@ pub fn language() -> Language { /// [`node-types.json`]: https://tree-sitter.github.io/tree-sitter/using-parsers#static-node-types pub const NODE_TYPES: &str = include_str!("../../src/node-types.json"); +/// The syntax highlighting queries. +pub const HIGHLIGHTS_QUERY: &str = include_str!("../../queries/highlights.scm"); + #[cfg(test)] mod tests { #[test] diff --git a/queries/highlights.scm b/queries/highlights.scm new file mode 100644 index 0000000..1ea2bbb --- /dev/null +++ b/queries/highlights.scm @@ -0,0 +1,14 @@ +[ + "%" + "%%" + (type) +] @embedded + +(flags) @boolean + +[ + (width) + (precision) +] @number + +(size) @type