提交 f68f9899 编写于 作者: B Benjamin Pasero

relauncher: prevent duplicate ext host restart

上级 e1b66a94
......@@ -105,7 +105,13 @@ export class SettingsChangeRelauncher implements IWorkbenchContribution {
// React to folder changes when we are in workspace state
if (this.contextService.getWorkbenchState() === WorkbenchState.WORKSPACE) {
if (!this.onDidChangeWorkspaceFoldersUnbind) {
this.onDidChangeWorkspaceFoldersUnbind = this.contextService.onDidChangeWorkspaceFolders(() => this.onDidChangeWorkspaceFolders());
// use a timeout here to prevent event spam because a folder change event
// might follow right after and we really only want to react on folder
// changes from within the workspace and not during state transition.
setTimeout(() => {
this.onDidChangeWorkspaceFoldersUnbind = this.contextService.onDidChangeWorkspaceFolders(() => this.onDidChangeWorkspaceFolders());
}, 0);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册