From 3e7472f76c70c3b0a31bb72f6f318c1aa1aba83d Mon Sep 17 00:00:00 2001 From: Aramis Razzaghipour Date: Fri, 28 May 2021 09:25:32 +1000 Subject: Add `public` semantic token modifier for public items --- .../test_data/highlighting.html | 42 +++++++++++++--------- 1 file changed, 25 insertions(+), 17 deletions(-) (limited to 'crates/ide/src/syntax_highlighting/test_data/highlighting.html') diff --git a/crates/ide/src/syntax_highlighting/test_data/highlighting.html b/crates/ide/src/syntax_highlighting/test_data/highlighting.html index 9232cf905..63daf25c6 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlighting.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlighting.html @@ -45,26 +45,26 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd macro Copy {} // Needed for function consuming vs normal -pub mod marker { +pub mod marker { #[lang = "copy"] - pub trait Copy {} + pub trait Copy {} } -pub mod ops { +pub mod ops { #[lang = "fn_once"] - pub trait FnOnce<Args> {} + pub trait FnOnce<Args> {} #[lang = "fn_mut"] - pub trait FnMut<Args>: FnOnce<Args> {} + pub trait FnMut<Args>: FnOnce<Args> {} #[lang = "fn"] - pub trait Fn<Args>: FnMut<Args> {} + pub trait Fn<Args>: FnMut<Args> {} } struct Foo { - pub x: i32, - pub y: i32, + pub x: i32, + pub y: i32, } trait Bar where Self: { @@ -73,7 +73,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd impl Bar for Foo where Self: { fn bar(&self) -> i32 { - self.x + self.x } } @@ -83,11 +83,11 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd } fn qux(&mut self) { - self.x = 0; + self.x = 0; } fn quop(&self) -> i32 { - self.x + self.x } } @@ -128,8 +128,8 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd FOO } -use ops::Fn; -fn baz<F: Fn() -> ()>(f: F) { +use ops::Fn; +fn baz<F: Fn() -> ()>(f: F) { f() } @@ -181,7 +181,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd let mut vec = Vec::new(); if true { let x = 92; - vec.push(Foo { x, y: 1 }); + vec.push(Foo { x, y: 1 }); } unsafe { vec.set_len(0); @@ -198,12 +198,12 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd let y = &mut x; let z = &y; - let Foo { x: z, y } = Foo { x: z, y }; + let Foo { x: z, y } = Foo { x: z, y }; y; - let mut foo = Foo { x, y: x }; - let foo2 = Foo { x, y: x }; + let mut foo = Foo { x, y: x }; + let foo2 = Foo { x, y: x }; foo.quop(); foo.qux(); foo.baz(foo2); @@ -269,5 +269,13 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd } } +pub enum Bool { True, False } + +impl Bool { + pub const fn to_primitive(self) -> bool { + matches!(self, Self::True) + } +} +const USAGE_OF_BOOL:bool = Bool::True.to_primitive(); \ No newline at end of file -- cgit v1.2.3