diff options
| author | roife <roifewu@gmail.com> | 2024-04-20 10:07:33 +0800 |
|---|---|---|
| committer | roife <roifewu@gmail.com> | 2024-04-20 10:07:33 +0800 |
| commit | f7f02c0d127935aecf11b24420cdaba2cdfe0494 (patch) | |
| tree | 227d454c458e917397870726839f8638944fdb49 /src/tools/rust-analyzer/crates/ide | |
| parent | 0e9d845fc79b368795268431cd26a3865d4414b6 (diff) | |
| download | rust-f7f02c0d127935aecf11b24420cdaba2cdfe0494.tar.gz rust-f7f02c0d127935aecf11b24420cdaba2cdfe0494.zip | |
fix: remove space within `{}` when no fields in struct
Diffstat (limited to 'src/tools/rust-analyzer/crates/ide')
| -rw-r--r-- | src/tools/rust-analyzer/crates/ide/src/hover/tests.rs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/tools/rust-analyzer/crates/ide/src/hover/tests.rs b/src/tools/rust-analyzer/crates/ide/src/hover/tests.rs index ff3258b4dbb..52e57d78892 100644 --- a/src/tools/rust-analyzer/crates/ide/src/hover/tests.rs +++ b/src/tools/rust-analyzer/crates/ide/src/hover/tests.rs @@ -1039,7 +1039,27 @@ fn hover_record_struct_limit() { struct Foo { /* … */ } ``` "#]], - ) + ); + + // No extra spaces within `{}` when there are no fields + check_hover_fields_limit( + 5, + r#" + struct Foo$0 {} + "#, + expect![[r#" + *Foo* + + ```rust + test + ``` + + ```rust + // size = 0, align = 1 + struct Foo {} + ``` + "#]], + ); } #[test] |
