forked from DonJayamanne/pythonVSCode
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Closed as not planned
Closed as not planned
Copy link
Labels
area-internalLabel for non-user facing issuesLabel for non-user facing issuesdebtCovers everything internal: CI, testing, refactoring of the codebase, etc.Covers everything internal: CI, testing, refactoring of the codebase, etc.needs PRReady to be worked onReady to be worked on
Description
Currently we have a few timeouts when invoking VSC API to close documents.
Possible improvements:
- Invoke
workbench.action.closeAllEditorswith a very short timeout (1s) - Check if any documents are opened before invoking this
- Attempt to close the active editor before invoking this
- Iterate through editors, show the document one by one and close the docs
- Finally attempt
workbench.action.closeAllEditorswith the15stimeout.
The code is as follows:
export async function closeActiveWindows(): Promise<void> {
return new Promise<void>((resolve, reject) => {
vscode.commands.executeCommand('workbench.action.closeAllEditors')
// tslint:disable-next-line:no-unnecessary-callback-wrapper
.then(() => resolve(), reject);
// Attempt to fix #1301.
// Lets not waste too much time.
setTimeout(() => {
reject(new Error('Command \'workbench.action.closeAllEditors\' timed out'));
}, 15000);
});
}Metadata
Metadata
Assignees
Labels
area-internalLabel for non-user facing issuesLabel for non-user facing issuesdebtCovers everything internal: CI, testing, refactoring of the codebase, etc.Covers everything internal: CI, testing, refactoring of the codebase, etc.needs PRReady to be worked onReady to be worked on