File tree Expand file tree Collapse file tree
extensions/vscode-api-tests/src/singlefolder-tests Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -154,4 +154,28 @@ suite('workspace-fs', () => {
154154 assert . ok ( true ) ;
155155 }
156156 } ) ;
157+
158+ test ( 'vscode.workspace.fs.remove() (and copy()) succeed unexpectedly. #84177' , async function ( ) {
159+ const entries = await vscode . workspace . fs . readDirectory ( root ) ;
160+ assert . ok ( entries . length > 0 ) ;
161+
162+ const folder = root . with ( { path : posix . join ( root . path , 'folder' ) } ) ;
163+ const file = root . with ( { path : posix . join ( root . path , 'folder/file' ) } ) ;
164+
165+ await vscode . workspace . fs . createDirectory ( folder ) ;
166+ await vscode . workspace . fs . writeFile ( file , Buffer . from ( 'FOO' ) ) ;
167+
168+ const someFolder = root . with ( { path : posix . join ( root . path , '6b1f9d664a92/a564c52da70a' ) } ) ;
169+
170+ try {
171+ await vscode . workspace . fs . copy ( folder , someFolder , { overwrite : true } ) ;
172+ assert . ok ( true ) ;
173+ } catch ( err ) {
174+ assert . ok ( false , err ) ;
175+
176+ } finally {
177+ await vscode . workspace . fs . delete ( folder , { recursive : true , useTrash : false } ) ;
178+ await vscode . workspace . fs . delete ( someFolder , { recursive : true , useTrash : false } ) ;
179+ }
180+ } ) ;
157181} ) ;
You can’t perform that action at this time.
0 commit comments