mirror of https://github.com/helix-editor/helix
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. |
||
---|---|---|
.. | ||
generated | ||
guides | ||
SUMMARY.md | ||
building-from-source.md | ||
command-line.md | ||
commands.md | ||
configuration.md | ||
ecosystem.md | ||
editor.md | ||
from-vim.md | ||
install.md | ||
keymap.md | ||
lang-support.md | ||
languages.md | ||
other-software.md | ||
package-managers.md | ||
pickers.md | ||
registers.md | ||
remapping.md | ||
surround.md | ||
syntax-aware-motions.md | ||
textobjects.md | ||
themes.md | ||
title-page.md | ||
usage.md |