mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-04 11:34:51 +00:00
Remove alias definition naively
This commit is contained in:
parent
afa374e58e
commit
fcc61337a8
@ -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"]
|
||||||
}
|
}
|
||||||
|
@ -1390,7 +1390,7 @@ fn foo() {
|
|||||||
}
|
}
|
||||||
"#####,
|
"#####,
|
||||||
r#####"
|
r#####"
|
||||||
type A = i32;
|
|
||||||
fn id(x: i32) -> i32 {
|
fn id(x: i32) -> i32 {
|
||||||
x
|
x
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user