File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -93,7 +93,7 @@ export default class ApplyEditAdapter {
9393 private static async handleResourceOperation ( edit : ( CreateFile | RenameFile | DeleteFile ) ) : Promise < void > {
9494 if ( DeleteFile . is ( edit ) ) {
9595 const path = Convert . uriToPath ( edit . uri )
96- const exists = fs . existsSync ( path )
96+ const exists = await fs . promises . stat ( path ) . then ( ( ) => true ) . catch ( ( ) => false )
9797 const ignoreIfNotExists = edit . options ?. ignoreIfNotExists
9898
9999 if ( ! exists ) {
@@ -124,7 +124,7 @@ export default class ApplyEditAdapter {
124124 if ( RenameFile . is ( edit ) ) {
125125 const oldPath = Convert . uriToPath ( edit . oldUri )
126126 const newPath = Convert . uriToPath ( edit . newUri )
127- const exists = fs . existsSync ( newPath )
127+ const exists = await fs . promises . stat ( newPath ) . then ( ( ) => true ) . catch ( ( ) => false )
128128 const ignoreIfExists = edit . options ?. ignoreIfExists
129129 const overwrite = edit . options ?. overwrite
130130
@@ -140,7 +140,7 @@ export default class ApplyEditAdapter {
140140 }
141141 if ( CreateFile . is ( edit ) ) {
142142 const path = Convert . uriToPath ( edit . uri )
143- const exists = fs . existsSync ( path )
143+ const exists = await fs . promises . stat ( path ) . then ( ( ) => true ) . catch ( ( ) => false )
144144 const ignoreIfExists = edit . options ?. ignoreIfExists
145145 const overwrite = edit . options ?. overwrite
146146
You can’t perform that action at this time.
0 commit comments