about summary refs log tree commit diff
diff options
context:
space:
mode:
authorYoung-Flash <dongyang@apache.org>2024-07-19 22:31:28 +0800
committerYoung-Flash <dongyang@apache.org>2024-07-20 09:33:23 +0800
commit7bff592cad82bccf4de97bc2d2e0ce7f55037ab7 (patch)
tree71138b5cfba1b8cb52906c51224c032308179782
parentaee0e30bedce88b8adadfbdbb4c93ce2c0cf492a (diff)
downloadrust-7bff592cad82bccf4de97bc2d2e0ce7f55037ab7.tar.gz
rust-7bff592cad82bccf4de97bc2d2e0ce7f55037ab7.zip
internal: add test case for inlay hint support for block expr with lifetime label
-rw-r--r--src/tools/rust-analyzer/crates/ide/src/inlay_hints/closing_brace.rs23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closing_brace.rs b/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closing_brace.rs
index de11ca4f690..89654e40489 100644
--- a/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closing_brace.rs
+++ b/src/tools/rust-analyzer/crates/ide/src/inlay_hints/closing_brace.rs
@@ -199,4 +199,27 @@ fn f() {
 "#,
         );
     }
+
+    #[test]
+    fn hints_closing_brace_for_block_expr() {
+        check_with_config(
+            InlayHintsConfig { closing_brace_hints_min_lines: Some(2), ..DISABLED_CONFIG },
+            r#"
+fn test() {
+    'end: {
+        'do_a: {
+            'do_b: {
+
+            }
+          //^ 'do_b
+            break 'end;
+        }
+      //^ 'do_a
+    }
+  //^ 'end
+  }
+//^ fn test
+"#,
+        );
+    }
 }