This is a bit hacky. Injections cannot stack on each other like
highlights because layers can have their own injections. So this new
language `rust-format-args-macro` emulates that. It unconditionally
injects `rust-format-args` into all strings. Rust injects this new
language into known format-args macros like `println!`.
The downside is that this can cause false-positive highlights within
these macros for strings which happen to contain format-args syntax
println!("Hello, {}!", "{}");
// ^ format args syntax
// ^ not format args syntax, but highlighted
// as if it were :(
This false-positive case is expected to be rare.
Injecting this fake language fixes regular non-string highlights in
macro invocations: macro invocations need to inject the entire token
tree and use `injection.include-children` for proper highlighting.
Note that this injection doesn't work currently because precedence is
not handled by the current syntax highlighter. The switch to tree-house
will properly handle the precedence of this pattern.
* add tree-sitter-regex
* adapt regex highlights from upstream
* inject regex into elixir sigil_r/2 and sigil_R/2
* generate lang-support docs
* capture interesting nodes in character-ranges
* make $.character_class captures more consistent
* fix fallthrough behavior for character classes
* capture pattern characters as 'string'
* use latest tree-sitter-regex
* set elixir regex injections as combined
* add link to upstream queries
* inject regex in rust into 'Regex::new' raw string literals