Skip to content

Commit 3400ec4

Browse files
authored
wait for trust to be initialized before prompting in tasks (microsoft#158323)
fix microsoft#156183
1 parent 6523fbe commit 3400ec4

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2788,10 +2788,14 @@ export abstract class AbstractTaskService extends Disposable implements ITaskSer
27882788
}
27892789

27902790
private async _trust(): Promise<boolean> {
2791-
return (await this._workspaceTrustRequestService.requestWorkspaceTrust(
2792-
{
2793-
message: nls.localize('TaskService.requestTrust', "Listing and running tasks requires that some of the files in this workspace be executed as code.")
2794-
})) === true;
2791+
await this._workspaceTrustManagementService.workspaceTrustInitialized;
2792+
if (!this._workspaceTrustManagementService.isWorkspaceTrusted()) {
2793+
return (await this._workspaceTrustRequestService.requestWorkspaceTrust(
2794+
{
2795+
message: nls.localize('TaskService.requestTrust', "Listing and running tasks requires that some of the files in this workspace be executed as code.")
2796+
})) === true;
2797+
}
2798+
return true;
27952799
}
27962800

27972801
private async _runTaskCommand(filter?: any | { type?: string; task?: string }): Promise<void> {

0 commit comments

Comments
 (0)