Fix language server renaming when parent directory does not exist (#43499)

Update the `fs::RenameOptions` used by
`project::lsp_store::LocalLspStore.deserialize_workspace_edit` in order
to always set `create_parents` to `true`. Doing this ensures that we'll
always create the folders for the new file path provided by the language
server instead of failing to handle the request in case the parent

- Introduce `create_parents` field to `fs::RenameOptions`
- Update `fs::RealFs.rename` to ensure that the `create_parents` option
is respected

Closes #41820 

Release Notes:

- Fixed a bug where using language server's file renaming actions could
fail if the parent directory of the new file did not exist
This commit is contained in:
Dino
2025-11-26 19:34:03 +00:00
committed by GitHub
parent 233b976441
commit 61a414df77
5 changed files with 94 additions and 11 deletions
+2
View File
@@ -379,6 +379,7 @@ async fn test_renaming_case_only(cx: &mut TestAppContext) {
fs::RenameOptions {
overwrite: true,
ignore_if_exists: true,
create_parents: false,
},
)
.await
@@ -1986,6 +1987,7 @@ async fn randomly_mutate_fs(
fs::RenameOptions {
overwrite: true,
ignore_if_exists: true,
create_parents: false,
},
)
.await