Skip to content

Commit 8c23860

Browse files
committed
Suppress our conflict resolution dialog in favour of native FSP one
1 parent 02bed5e commit 8c23860

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/providers/FileSystemProvider/FileSystemProvider.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -203,12 +203,16 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
203203
// The actual writing is done by our workspace.onDidSaveTextDocument handler.
204204
// But first check a case for which we should fail the write and leave the document dirty if changed.
205205
if (fileName.split(".").pop().toLowerCase() === "cls") {
206-
return api.actionIndex([fileName]).then((result) => {
206+
api.actionIndex([fileName]).then((result) => {
207207
if (result.result.content[0].content.depl) {
208208
throw new Error("Cannot overwrite a deployed class");
209209
}
210210
});
211211
}
212+
// Set a -1 mtime cache entry so the actual write by the workspace.onDidSaveTextDocument handler always overwrites.
213+
// By the time we get here VS Code's built-in conflict resolution mechanism will already have interacted with the user.
214+
const uniqueId = `${workspaceFolderOfUri(uri)}:${fileName}`;
215+
workspaceState.update(`${uniqueId}:mtime`, -1);
212216
return;
213217
},
214218
(error) => {

0 commit comments

Comments
 (0)