Skip to content

Commit f426c29

Browse files
authored
Fix lsp--on-rename-file so that rename-file is always applied (#4788)
1 parent ee52b3b commit f426c29

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

lsp-mode.el

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6647,11 +6647,13 @@ to check if server wants to apply any workspaceEdits after renamed."
66476647
:files (vector (lsp-make-file-rename
66486648
:oldUri (lsp--path-to-uri old-name)
66496649
:newUri (lsp--path-to-uri new-name))))))
6650-
(when-let* ((edits (lsp-request "workspace/willRenameFiles" params)))
6651-
(lsp--apply-workspace-edit edits 'rename-file)
6652-
(funcall old-func old-name new-name ok-if-already-exists?)
6653-
(when (lsp--send-did-rename-files-p)
6654-
(lsp-notify "workspace/didRenameFiles" params))))
6650+
(if-let* ((edits (lsp-request "workspace/willRenameFiles" params)))
6651+
(progn
6652+
(lsp--apply-workspace-edit edits 'rename-file)
6653+
(funcall old-func old-name new-name ok-if-already-exists?)
6654+
(when (lsp--send-did-rename-files-p)
6655+
(lsp-notify "workspace/didRenameFiles" params)))
6656+
(funcall old-func old-name new-name ok-if-already-exists?)))
66556657
(funcall old-func old-name new-name ok-if-already-exists?)))
66566658

66576659
(advice-add 'rename-file :around #'lsp--on-rename-file)

0 commit comments

Comments
 (0)