From d7dcd41801b319f64f3ca2ed22735ab70092e491 Mon Sep 17 00:00:00 2001 From: Chetan Khilosiya Date: Wed, 31 Mar 2021 00:30:01 +0530 Subject: 8024: Added test case for highlighting trait items. --- .../test_data/highlight_trait_items.html | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 crates/ide/src/syntax_highlighting/test_data/highlight_trait_items.html (limited to 'crates/ide/src/syntax_highlighting/test_data') diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_trait_items.html b/crates/ide/src/syntax_highlighting/test_data/highlight_trait_items.html new file mode 100644 index 000000000..85274a61f --- /dev/null +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_trait_items.html @@ -0,0 +1,67 @@ + + +
struct Cat;
+
+trait Animal {
+    const SOUND: &'static str;
+
+    fn make_sound(&self) {
+        println!("{}", Self::SOUND);
+    }
+}
+
+impl Animal for Cat {
+    const SOUND: &'static str = "Meow!";
+}
+
+impl Cat {
+    const SPEED: u32 = 2;
+
+    fn run() {}
+}
+
+fn main() {
+    let cat = Cat;
+    cat.make_sound();
+    let _sound = Cat::SOUND;
+    let _speed = Cat::SPEED;
+    Cat::run();
+}
+
\ No newline at end of file -- cgit v1.2.3