mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Auto merge of #12712 - harpsword:fix-rename-crate-root, r=Veykril
fix: ignore renames for crate root close #12684 . I just ignore renames for crate root in `rename_mod` func.
This commit is contained in:
commit
ac526e029a
2 changed files with 33 additions and 0 deletions
|
@ -177,6 +177,10 @@ fn rename_mod(
|
|||
|
||||
let mut source_change = SourceChange::default();
|
||||
|
||||
if module.is_crate_root(sema.db) {
|
||||
return Ok(source_change);
|
||||
}
|
||||
|
||||
let InFile { file_id, value: def_source } = module.definition_source(sema.db);
|
||||
if let ModuleSource::SourceFile(..) = def_source {
|
||||
let anchor = file_id.original_file(sema.db);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue