MCPcopy Create free account
hub / github.com/deepnote/vscode-deepnote / closeWindowsImplementation

Function closeWindowsImplementation

src/test/initialize.ts:73–89  ·  view source on GitHub ↗
(timeout = 1_000)

Source from the content-addressed store, hash-verified

71 }
72 }
73 const closeWindowsImplementation = (timeout = 1_000) => {
74 return new Promise<void>((resolve, reject) => {
75 // Attempt to fix #1301.
76 // Lets not waste too much time.
77 const timer = setTimeout(() => reject(new CloseEditorsTimeoutError()), timeout);
78 vscode.commands.executeCommand('workbench.action.closeAllEditors').then(
79 () => {
80 clearTimeout(timer);
81 resolve();
82 },
83 (ex) => {
84 clearTimeout(timer);
85 reject(ex);
86 }
87 );
88 });
89 };
90
91 // For some reason some times the command times out.
92 // If this happens, just wait & retry, no idea why VS Code is flaky.

Callers 1

closeWindowsInternalFunction · 0.85

Calls 2

executeCommandMethod · 0.65
resolveFunction · 0.50

Tested by

no test coverage detected