()
| 446 | } |
| 447 | |
| 448 | export async function closeAllOpenFiles(): Promise<void> { |
| 449 | if (!vs.window.visibleTextEditors?.filter((editor) => editor.document.uri.scheme === "file").length) { |
| 450 | logger.info(`No open files to close`); |
| 451 | return; |
| 452 | } |
| 453 | |
| 454 | logger.info(`Reverting current editor...`); |
| 455 | await vs.commands.executeCommand("workbench.action.files.revert"); |
| 456 | logger.info(`Closing all open editors...`); |
| 457 | logOpenEditors(); |
| 458 | try { |
| 459 | await withTimeout( |
| 460 | vs.commands.executeCommand("workbench.action.closeAllEditors"), |
| 461 | "closeAllEditors all editors did not complete", |
| 462 | 10, |
| 463 | ); |
| 464 | } catch (e) { |
| 465 | logger.warn(e); |
| 466 | } |
| 467 | await delay(50); |
| 468 | logger.info(`Done closing editors!`); |
| 469 | logOpenEditors(); |
| 470 | } |
| 471 | |
| 472 | export async function clearTestTree(): Promise<void> { |
| 473 | logger.info(`Clearing test tree...`); |
no test coverage detected