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/syntax_highlighting/tests.rs | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) (limited to 'crates/ra_ide/src/syntax_highlighting/tests.rs') 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 From 56ce34c6a7ec0b4426d4cb25e10512c7efaf6f06 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Fri, 28 Feb 2020 16:49:46 +0100 Subject: Correctly flag 'lifetime definitions as definitions --- crates/ra_ide/src/syntax_highlighting/tests.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'crates/ra_ide/src/syntax_highlighting/tests.rs') diff --git a/crates/ra_ide/src/syntax_highlighting/tests.rs b/crates/ra_ide/src/syntax_highlighting/tests.rs index 21c4dd818..98c030791 100644 --- a/crates/ra_ide/src/syntax_highlighting/tests.rs +++ b/crates/ra_ide/src/syntax_highlighting/tests.rs @@ -17,9 +17,8 @@ struct Foo { pub y: i32, } -fn foo() -> T { - unimplemented!(); - foo::(); +fn foo<'a, T>() -> T { + foo::<'a, i32>() } macro_rules! def_fn { @@ -59,7 +58,7 @@ use Option::*; impl Option { fn and(self, other: Option) -> Option<(T, U)> { match other { - None => todo!(), + None => unimplemented!(), Nope => Nope, } } @@ -130,5 +129,5 @@ fn test_ranges() { .highlight_range(FileRange { file_id, range: TextRange::offset_len(82.into(), 1.into()) }) .unwrap(); - assert_eq!(&highlights[0].highlight.to_string(), "field"); + assert_eq!(&highlights[0].highlight.to_string(), "field.declaration"); } -- cgit v1.2.3