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 {
93
93
private static async handleResourceOperation ( edit : ( CreateFile | RenameFile | DeleteFile ) ) : Promise < void > {
94
94
if ( DeleteFile . is ( edit ) ) {
95
95
const path = Convert . uriToPath ( edit . uri )
96
- const exists = fs . existsSync ( path )
96
+ const exists = await fs . promises . stat ( path ) . then ( ( ) => true ) . catch ( ( ) => false )
97
97
const ignoreIfNotExists = edit . options ?. ignoreIfNotExists
98
98
99
99
if ( ! exists ) {
@@ -124,7 +124,7 @@ export default class ApplyEditAdapter {
124
124
if ( RenameFile . is ( edit ) ) {
125
125
const oldPath = Convert . uriToPath ( edit . oldUri )
126
126
const newPath = Convert . uriToPath ( edit . newUri )
127
- const exists = fs . existsSync ( newPath )
127
+ const exists = await fs . promises . stat ( newPath ) . then ( ( ) => true ) . catch ( ( ) => false )
128
128
const ignoreIfExists = edit . options ?. ignoreIfExists
129
129
const overwrite = edit . options ?. overwrite
130
130
@@ -140,7 +140,7 @@ export default class ApplyEditAdapter {
140
140
}
141
141
if ( CreateFile . is ( edit ) ) {
142
142
const path = Convert . uriToPath ( edit . uri )
143
- const exists = fs . existsSync ( path )
143
+ const exists = await fs . promises . stat ( path ) . then ( ( ) => true ) . catch ( ( ) => false )
144
144
const ignoreIfExists = edit . options ?. ignoreIfExists
145
145
const overwrite = edit . options ?. overwrite
146
146
You can’t perform that action at this time.
0 commit comments