Merge #9646
9646: add 'use' prefix for any auto-import r=Veykril a=mahdi-frms Fixes #9643 looks like there was an if condition that had to be removed. Co-authored-by: mahdi-frms <mahdif1380@outlook.com>
This commit is contained in:
commit
a646ddf230
@ -368,9 +368,9 @@ fn main() {
|
||||
}
|
||||
"#,
|
||||
expect![[r#"
|
||||
st dep::some_module::ThirdStruct
|
||||
st dep::some_module::AfterThirdStruct
|
||||
st dep::some_module::ThiiiiiirdStruct
|
||||
st ThirdStruct (use dep::some_module::ThirdStruct)
|
||||
st AfterThirdStruct (use dep::some_module::AfterThirdStruct)
|
||||
st ThiiiiiirdStruct (use dep::some_module::ThiiiiiirdStruct)
|
||||
"#]],
|
||||
);
|
||||
}
|
||||
@ -817,7 +817,7 @@ fn main() {
|
||||
check(
|
||||
fixture,
|
||||
expect![[r#"
|
||||
st foo::bar::baz::Item
|
||||
st Item (use foo::bar::baz::Item)
|
||||
"#]],
|
||||
);
|
||||
|
||||
@ -997,7 +997,7 @@ fn main() {
|
||||
TE$0
|
||||
}"#,
|
||||
expect![[r#"
|
||||
ct foo::TEST_CONST
|
||||
ct TEST_CONST (use foo::TEST_CONST)
|
||||
"#]],
|
||||
);
|
||||
|
||||
@ -1014,7 +1014,7 @@ fn main() {
|
||||
te$0
|
||||
}"#,
|
||||
expect![[r#"
|
||||
ct foo::TEST_CONST
|
||||
ct TEST_CONST (use foo::TEST_CONST)
|
||||
fn test_function() (use foo::test_function) fn() -> i32
|
||||
"#]],
|
||||
);
|
||||
|
@ -429,13 +429,7 @@ impl Builder {
|
||||
{
|
||||
lookup = lookup.or_else(|| Some(label.clone()));
|
||||
insert_text = insert_text.or_else(|| Some(label.clone()));
|
||||
|
||||
let original_path_label = original_path.to_string();
|
||||
if original_path_label.ends_with(&label) {
|
||||
label = original_path_label;
|
||||
} else {
|
||||
format_to!(label, " (use {})", original_path)
|
||||
}
|
||||
format_to!(label, " (use {})", original_path)
|
||||
} else if let Some(trait_name) = self.trait_name {
|
||||
insert_text = insert_text.or_else(|| Some(label.clone()));
|
||||
format_to!(label, " (as {})", trait_name)
|
||||
|
Loading…
x
Reference in New Issue
Block a user