From 3baa526fb07184ce9804a06c8e0251971eea3b49 Mon Sep 17 00:00:00 2001 From: Anatol Liu Date: Wed, 4 Nov 2020 20:08:46 -0800 Subject: Add static semantic token modifier for associated functions with no &self --- .../test_data/highlight_assoc_functions.html | 56 ++++++++++++++++++++++ .../test_data/highlight_doctest.html | 2 +- .../test_data/highlight_injection.html | 2 +- 3 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 crates/ide/src/syntax_highlighting/test_data/highlight_assoc_functions.html (limited to 'crates/ide/src/syntax_highlighting/test_data') diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_assoc_functions.html b/crates/ide/src/syntax_highlighting/test_data/highlight_assoc_functions.html new file mode 100644 index 000000000..cd80d72b7 --- /dev/null +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_assoc_functions.html @@ -0,0 +1,56 @@ + + +
fn not_static() {}
+
+struct foo {}
+
+impl foo {
+    pub fn is_static() {}
+    pub fn is_not_static(&self) {}
+}
+
+trait t {
+    fn t_is_static() {}
+    fn t_is_not_static(&self) {}
+}
+
+impl t for foo {
+    pub fn is_static() {}
+    pub fn is_not_static(&self) {}
+}
+        
\ No newline at end of file diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html index 6322d404f..65fba8b02 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_doctest.html @@ -53,7 +53,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd /// # #![allow(unused_mut)] /// let mut foo: Foo = Foo::new(); /// ``` - pub const fn new() -> Foo { + pub const fn new() -> Foo { Foo { bar: true } } diff --git a/crates/ide/src/syntax_highlighting/test_data/highlight_injection.html b/crates/ide/src/syntax_highlighting/test_data/highlight_injection.html index 18addd00d..57c178916 100644 --- a/crates/ide/src/syntax_highlighting/test_data/highlight_injection.html +++ b/crates/ide/src/syntax_highlighting/test_data/highlight_injection.html @@ -40,7 +40,7 @@ pre { color: #DCDCCC; background: #3F3F3F; font-size: 22px; padd fn main() { fixture(r#" trait Foo { - fn foo() { + fn foo() { println!("2 + 2 = {}", 4); } }"# -- cgit v1.2.3