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 {
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 ) => {
You can’t perform that action at this time.
0 commit comments