MCPcopy Create free account
hub / github.com/Dart-Code/Dart-Code / closeAllOpenFiles

Function closeAllOpenFiles

src/test/helpers.ts:448–470  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

446}
447
448export 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
472export async function clearTestTree(): Promise<void> {
473 logger.info(`Clearing test tree...`);

Callers 9

dart_cli.test.tsFile · 0.90
mcp_server.test.tsFile · 0.90
helpers.test.tsFile · 0.90
renames.test.tsFile · 0.90
web.test.tsFile · 0.90
activateWithoutAnalysisFunction · 0.85

Calls 6

withTimeoutFunction · 0.90
logOpenEditorsFunction · 0.85
delayFunction · 0.85
infoMethod · 0.65
executeCommandMethod · 0.65
warnMethod · 0.65

Tested by

no test coverage detected