about summary refs log tree commit diff
diff options
context:
space:
mode:
authorroife <roifewu@gmail.com>2024-02-27 12:23:15 +0800
committerroife <roifewu@gmail.com>2024-02-27 20:53:07 +0800
commitec5236f3a8f9ea29abe36e173d9b087f5ede629c (patch)
treea1e477a36f078771e09c2f1b32dbd19662207270
parent48966268fcf560d8c132edea3b1028fa177d78b8 (diff)
test: use 4 spaces for indetation in macro expansion
-rw-r--r--crates/ide-assists/src/handlers/inline_call.rs8
-rw-r--r--crates/ide-assists/src/handlers/inline_macro.rs10
-rw-r--r--crates/ide/src/expand_macro.rs58
-rw-r--r--crates/ide/src/hover/tests.rs6
4 files changed, 41 insertions, 41 deletions
diff --git a/crates/ide-assists/src/handlers/inline_call.rs b/crates/ide-assists/src/handlers/inline_call.rs
index 7531dd5c035..ab19779f4e8 100644
--- a/crates/ide-assists/src/handlers/inline_call.rs
+++ b/crates/ide-assists/src/handlers/inline_call.rs
@@ -1348,8 +1348,8 @@ macro_rules! define_foo {
 define_foo!();
 fn bar() -> u32 {
     {
-      let x = 0;
-      x
+        let x = 0;
+        x
     }
 }
 "#,
@@ -1662,7 +1662,7 @@ fn main() {
     let a: A = A{};
     let b = {
         let a = a;
-      a as A
+        a as A
     };
 }
 "#,
@@ -1781,7 +1781,7 @@ fn _hash2(self_: &u64, state: &mut u64) {
     {
         let inner_self_: &u64 = &self_;
         let state: &mut u64 = state;
-      _write_u64(state, *inner_self_)
+        _write_u64(state, *inner_self_)
     };
 }
 "#,
diff --git a/crates/ide-assists/src/handlers/inline_macro.rs b/crates/ide-assists/src/handlers/inline_macro.rs
index 0c9e971dd23..4708be61696 100644
--- a/crates/ide-assists/src/handlers/inline_macro.rs
+++ b/crates/ide-assists/src/handlers/inline_macro.rs
@@ -288,11 +288,11 @@ macro_rules! foo {
 }
 fn main() {
     cfg_if!{
-  if #[cfg(test)]{
-    1;
-  }else {
-    1;
-  }
+    if #[cfg(test)]{
+        1;
+    }else {
+        1;
+    }
 };
 }
 "#,
diff --git a/crates/ide/src/expand_macro.rs b/crates/ide/src/expand_macro.rs
index 17c701ad035..9eb5a9db625 100644
--- a/crates/ide/src/expand_macro.rs
+++ b/crates/ide/src/expand_macro.rs
@@ -308,8 +308,8 @@ f$0oo!();
             expect![[r#"
                 foo!
                 fn some_thing() -> u32 {
-                  let a = 0;
-                  a+10
+                    let a = 0;
+                    a+10
                 }"#]],
         );
     }
@@ -342,13 +342,13 @@ fn main() {
             expect![[r#"
                 match_ast!
                 {
-                  if let Some(it) = ast::TraitDef::cast(container.clone()){}
-                  else if let Some(it) = ast::ImplDef::cast(container.clone()){}
-                  else {
-                    {
-                      continue
+                    if let Some(it) = ast::TraitDef::cast(container.clone()){}
+                    else if let Some(it) = ast::ImplDef::cast(container.clone()){}
+                    else {
+                        {
+                            continue
+                        }
                     }
-                  }
                 }"#]],
         );
     }
@@ -397,12 +397,12 @@ fn main() {
             expect![[r#"
                 foo!
                 {
-                  macro_rules! bar {
-                    () => {
-                      42
+                    macro_rules! bar {
+                        () => {
+                            42
+                        }
                     }
-                  }
-                  42
+                    42
                 }"#]],
         );
     }
@@ -482,16 +482,16 @@ struct Foo {}
             expect![[r#"
                 Clone
                 impl < >$crate::clone::Clone for Foo< >where {
-                  fn clone(&self) -> Self {
-                    match self {
-                      Foo{}
-                       => Foo{}
-                      ,
+                    fn clone(&self) -> Self {
+                        match self {
+                            Foo{}
+                             => Foo{}
+                            ,
 
-                      }
-                  }
+                            }
+                    }
 
-                  }"#]],
+                    }"#]],
         );
     }
 
@@ -534,16 +534,16 @@ struct Foo {}
             expect![[r#"
                 Clone
                 impl < >$crate::clone::Clone for Foo< >where {
-                  fn clone(&self) -> Self {
-                    match self {
-                      Foo{}
-                       => Foo{}
-                      ,
+                    fn clone(&self) -> Self {
+                        match self {
+                            Foo{}
+                             => Foo{}
+                            ,
 
-                      }
-                  }
+                            }
+                    }
 
-                  }"#]],
+                    }"#]],
         );
     }
 }
diff --git a/crates/ide/src/hover/tests.rs b/crates/ide/src/hover/tests.rs
index ead4f91595f..7ecfdfb1942 100644
--- a/crates/ide/src/hover/tests.rs
+++ b/crates/ide/src/hover/tests.rs
@@ -6341,8 +6341,8 @@ fn main() { $0V; }
 
             ```rust
             pub const V: i8 = {
-              let e = 123;
-              f(e)
+                let e = 123;
+                f(e)
             }
             ```
         "#]],
@@ -6368,7 +6368,7 @@ fn main() { $0V; }
 
             ```rust
             pub static V: i8 = {
-              let e = 123;
+                let e = 123;
             }
             ```
         "#]],