Rust syntax highlighting compatibility with rust-script
-style scripting.
#10904
Labels
A-language-support
Area: Support for programming/text languages
C-enhancement
Category: Improvements
When using
rust-script
, it's possible to write a shell-style script in Rust code, using a hashbang at the top. This is nifty, but when working in Helix, the syntax highlighting is incorrect for this use case:With a small adjustment, it should work well enough that an entirely new workflow for working in Rust as a high-performance and type safe alternative to conventional scripting, would become more feasible.
Note that if I comment out the hashbang, the rest of the code now has correct highlighting:
This use case is becoming popular, to the point that there has been an experimental
cargo
RFC out for an essentially identical use case upstream (although it's still feature gated):https://github.com/rust-lang/rfcs/blob/master/text/3424-cargo-script.md
Having syntax highlighting that can correctly ignore the initial hashbang (regardless of target), would fix this for
rust-script
, while being backward compatible with the earlycargo-script
project, and future-proof for upstream'scargo script
.The text was updated successfully, but these errors were encountered: