From 5ebfcb9cb757ece936f631cf69136e1d38cb6afc Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 28 Feb 2020 16:36:14 +0100 Subject: Fix highlighting of const patterns --- crates/ra_ide/src/snapshots/highlighting.html | 15 +++++++++++---- crates/ra_ide/src/syntax_highlighting/tests.rs | 17 ++++++++++++----- 2 files changed, 23 insertions(+), 9 deletions(-) (limited to 'crates/ra_ide/src') diff --git a/crates/ra_ide/src/snapshots/highlighting.html b/crates/ra_ide/src/snapshots/highlighting.html index 8c372ad27..cb4097e05 100644 --- a/crates/ra_ide/src/snapshots/highlighting.html +++ b/crates/ra_ide/src/snapshots/highlighting.html @@ -65,10 +65,17 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd y; } -enum E<X> { - V(X) +enum Option<T> { + Some(T), + None, } +use Option::*; -impl<X> E<X> { - fn new<T>() -> E<T> {} +impl<T> Option<T> { + fn and<U>(self, other: Option<U>) -> Option<(T, U)> { + match other { + None => todo!(), + Nope => Nope, + } + } } \ No newline at end of file diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs index 2d90a072f..21c4dd818 100644 --- a/crates/ra_ide/src/syntax_highlighting/tests.rs +++ b/crates/ra_ide/src/syntax_highlighting/tests.rs @@ -50,12 +50,19 @@ fn main() { y; } -enum E { - V(X) +enum Option { + Some(T), + None, } - -impl E { - fn new() -> E {} +use Option::*; + +impl Option { + fn and(self, other: Option) -> Option<(T, U)> { + match other { + None => todo!(), + Nope => Nope, + } + } } "# .trim(), -- cgit v1.2.3