Remove alias definition naively

This commit is contained in:
ice1000 2022-08-23 04:59:41 +00:00
parent afa374e58e
commit fcc61337a8
2 changed files with 7 additions and 4 deletions

View File

@ -31,7 +31,7 @@ use crate::{
// ``` // ```
// -> // ->
// ``` // ```
// type A = i32; //
// fn id(x: i32) -> i32 { // fn id(x: i32) -> i32 {
// x // x
// }; // };
@ -84,6 +84,9 @@ pub(crate) fn inline_type_alias_uses(acc: &mut Assists, ctx: &AssistContext<'_>)
for (file_id, refs) in usages.into_iter() { for (file_id, refs) in usages.into_iter() {
inline_refs_for_file(file_id, refs); inline_refs_for_file(file_id, refs);
} }
builder.edit_file(ctx.file_id());
builder.delete(ast_alias.syntax().text_range());
}, },
) )
} }
@ -929,7 +932,7 @@ fn foo() {
} }
"#, "#,
r#" r#"
type A = u32;
fn foo() { fn foo() {
let _: u32 = 3; let _: u32 = 3;
@ -960,7 +963,7 @@ fn foo() {
r#" r#"
//- /lib.rs //- /lib.rs
mod foo; mod foo;
type T<E> = Vec<E>;
fn f() -> Vec<&str> { fn f() -> Vec<&str> {
vec!["hello"] vec!["hello"]
} }

View File

@ -1390,7 +1390,7 @@ fn foo() {
} }
"#####, "#####,
r#####" r#####"
type A = i32;
fn id(x: i32) -> i32 { fn id(x: i32) -> i32 {
x x
}; };