Open
Description
Sublime Text Version
Sublime Text 3.2 (Build 3200) (when tested on Windows)
Rust Enhanced Version
2.19.0 (when tested on Windows)
Operating system
Tested on both Linux Mint and Windows 10
Expected behavior
From the Rust reference, regarding match
grammar:
MatchArmPatterns :
|? Pattern ( | Pattern )*
are valid MatchArmPatterns
and should be colored accordingly.
Actual behavior
But the optional first pipe (|
) sygil, when used right after the opening brace of the match
expression leads to an incorrect syntax highlighting (might be related to closure syntax).
The current work around is to add a comment between the opening brace and the first pattern.
Steps to reproduce
-
fn main () { match None { | Some(42) /* <- not highlighted */ => {}, | Some(x) => {}, | None => {} } }
-
fn main () { match None {// | Some(42) /* <- good highlighting */ => {}, | Some(x) => {}, | None => {} } }
References
Maybe #284