vscode.workspace.applyEdit doesnt auto save changes while refactoring #168825
Closed
Description
Does this issue occur when all extensions are disabled?: Yes
Version: 1.75.0-insider
Commit: f076d553210e9ea65e7bccbfa2f7a786c10fcab2
Date: 2022-12-09T09:18:09.258Z
Electron: 19.1.8
Chromium: 102.0.5005.167
Node.js: 16.14.2
V8: 10.2.154.15-electron.0
OS: Darwin arm64 21.6.0
Sandboxed: Yes
Issue
am trying to update php files references on file rename/move using onDidRenameFiles
+ vscode.workspace.applyEdit
but after the changes are made, the file are keept opened and changes are not saved.
i also have "files.refactoring.autoSave": true
but its not working.
Api example:
let edit = new vscode.WorkspaceEdit edit.replace(file.uri, file.range, 'something new') await vscode.workspace.applyEdit(edit, { isRefactoring: true })
Steps to Reproduce:
- register a
onDidRenameFiles
listener - create a main file to test with and add some data that
vscode.executeReferenceProvider
can pick up - create a couple other files with a reference to the main file
- try to apply the changes on file rename to all the references
- all files will be updated but will remian opened