File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
src/providers/FileSystemProvider Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -203,12 +203,16 @@ export class FileSystemProvider implements vscode.FileSystemProvider {
203
203
// The actual writing is done by our workspace.onDidSaveTextDocument handler.
204
204
// But first check a case for which we should fail the write and leave the document dirty if changed.
205
205
if ( fileName . split ( "." ) . pop ( ) . toLowerCase ( ) === "cls" ) {
206
- return api . actionIndex ( [ fileName ] ) . then ( ( result ) => {
206
+ api . actionIndex ( [ fileName ] ) . then ( ( result ) => {
207
207
if ( result . result . content [ 0 ] . content . depl ) {
208
208
throw new Error ( "Cannot overwrite a deployed class" ) ;
209
209
}
210
210
} ) ;
211
211
}
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 ) ;
212
216
return ;
213
217
} ,
214
218
( error ) => {
You can’t perform that action at this time.
0 commit comments