mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-15 17:28:09 +00:00
Add multi file test for "Convert to named struct" assist
This commit is contained in:
parent
96d694062b
commit
6630266ce1
1 changed files with 33 additions and 0 deletions
|
@ -384,6 +384,39 @@ impl A {
|
|||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn convert_struct_with_multi_file_references() {
|
||||
check_assist(
|
||||
convert_tuple_struct_to_named_struct,
|
||||
r#"
|
||||
//- /main.rs
|
||||
struct Inner;
|
||||
struct A$0(Inner);
|
||||
|
||||
mod foo;
|
||||
|
||||
//- /foo.rs
|
||||
use crate::{A, Inner};
|
||||
fn f() {
|
||||
let a = A(Inner);
|
||||
}
|
||||
"#,
|
||||
r#"
|
||||
//- /main.rs
|
||||
struct Inner;
|
||||
struct A { field1: Inner }
|
||||
|
||||
mod foo;
|
||||
|
||||
//- /foo.rs
|
||||
use crate::{A, Inner};
|
||||
fn f() {
|
||||
let a = A { field1: Inner };
|
||||
}
|
||||
"#,
|
||||
);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn convert_struct_with_where_clause() {
|
||||
check_assist(
|
||||
|
|
Loading…
Reference in a new issue