mirror of
https://github.com/rust-lang/rust.git
synced 2025-04-28 02:57:37 +00:00
Don't return a SourceChange on WillRenameFiles when nothing gets refactored
This commit is contained in:
parent
d84912483d
commit
a9a7c5cb1f
@ -465,8 +465,11 @@ pub(crate) fn handle_will_rename_files(
|
||||
source_change.file_system_edits.clear();
|
||||
// no collect here because we want to merge text edits on same file ids
|
||||
source_change.extend(source_changes.map(|it| it.source_file_edits).flatten());
|
||||
let workspace_edit = to_proto::workspace_edit(&snap, source_change)?;
|
||||
Ok(Some(workspace_edit))
|
||||
if source_change.source_file_edits.is_empty() {
|
||||
Ok(None)
|
||||
} else {
|
||||
to_proto::workspace_edit(&snap, source_change).map(Some)
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) fn handle_goto_definition(
|
||||
|
@ -838,9 +838,7 @@ fn main() {}
|
||||
new_uri: base_path.join("src/from_mod/foo.rs").to_str().unwrap().to_string(),
|
||||
}],
|
||||
},
|
||||
json!({
|
||||
"documentChanges": []
|
||||
}),
|
||||
json!(null),
|
||||
);
|
||||
|
||||
//rename file from foo.rs to mod.rs
|
||||
@ -851,9 +849,7 @@ fn main() {}
|
||||
new_uri: base_path.join("src/to_mod/mod.rs").to_str().unwrap().to_string(),
|
||||
}],
|
||||
},
|
||||
json!({
|
||||
"documentChanges": []
|
||||
}),
|
||||
json!(null),
|
||||
);
|
||||
|
||||
//rename same level file
|
||||
|
Loading…
Reference in New Issue
Block a user