Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions crates/ide/src/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1108,6 +1108,31 @@ pub mod foo$0;
);
}

#[test]
fn test_rename_mod_ref_by_super() {
check(
"baz",
r#"
mod $0foo {
struct X;

mod bar {
use super::X;
}
}
"#,
r#"
mod baz {
struct X;

mod bar {
use super::X;
}
}
"#,
)
}

#[test]
fn test_enum_variant_from_module_1() {
cov_mark::check!(rename_non_local);
Expand Down
4 changes: 4 additions & 0 deletions crates/ide_db/src/rename.rs
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,10 @@ fn source_edit_from_name_ref(
new_name: &str,
def: Definition,
) -> bool {
if name_ref.super_token().is_some() {
return true;
}

if let Some(record_field) = ast::RecordExprField::for_name_ref(name_ref) {
let rcf_name_ref = record_field.name_ref();
let rcf_expr = record_field.expr();
Expand Down