mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-11-13 00:17:15 +00:00
Remove alias definition naively
This commit is contained in:
parent
afa374e58e
commit
fcc61337a8
2 changed files with 7 additions and 4 deletions
|
@ -31,7 +31,7 @@ use crate::{
|
|||
// ```
|
||||
// ->
|
||||
// ```
|
||||
// type A = i32;
|
||||
//
|
||||
// fn id(x: i32) -> i32 {
|
||||
// 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() {
|
||||
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#"
|
||||
type A = u32;
|
||||
|
||||
|
||||
fn foo() {
|
||||
let _: u32 = 3;
|
||||
|
@ -960,7 +963,7 @@ fn foo() {
|
|||
r#"
|
||||
//- /lib.rs
|
||||
mod foo;
|
||||
type T<E> = Vec<E>;
|
||||
|
||||
fn f() -> Vec<&str> {
|
||||
vec!["hello"]
|
||||
}
|
||||
|
|
|
@ -1390,7 +1390,7 @@ fn foo() {
|
|||
}
|
||||
"#####,
|
||||
r#####"
|
||||
type A = i32;
|
||||
|
||||
fn id(x: i32) -> i32 {
|
||||
x
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue