mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-29 06:23:25 +00:00
This should work, but I got mysterious errors
This commit is contained in:
parent
79e5c366cd
commit
277df02ff5
1 changed files with 1 additions and 5 deletions
|
@ -71,6 +71,7 @@ pub(crate) fn inline_type_alias_uses(acc: &mut Assists, ctx: &AssistContext<'_>)
|
|||
path_type.syntax().ancestors().nth(3).and_then(ast::PathType::cast)
|
||||
});
|
||||
|
||||
path_type_uses.iter().for_each(remove_path_if_in_use_stmt);
|
||||
for (target, replacement) in path_types.into_iter().filter_map(|path_type| {
|
||||
let replacement = inline(&ast_alias, &path_type)?.to_text(&concrete_type);
|
||||
let target = path_type.syntax().text_range();
|
||||
|
@ -78,10 +79,6 @@ pub(crate) fn inline_type_alias_uses(acc: &mut Assists, ctx: &AssistContext<'_>)
|
|||
}) {
|
||||
builder.replace(target, replacement);
|
||||
}
|
||||
if !path_type_uses.is_empty() {
|
||||
builder.edit_file(file_id);
|
||||
path_type_uses.iter().for_each(remove_path_if_in_use_stmt);
|
||||
}
|
||||
};
|
||||
|
||||
for (file_id, refs) in usages.into_iter() {
|
||||
|
@ -1001,7 +998,6 @@ mod foo;
|
|||
|
||||
|
||||
//- /foo.rs
|
||||
|
||||
fn foo() {
|
||||
let _: i32 = 0;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue