@@ -29,7 +29,7 @@ import { WORKSPACE_TRUST_BANNER, WORKSPACE_TRUST_EMPTY_WINDOW, WORKSPACE_TRUST_E
29
29
import { IEditorSerializer , IEditorFactoryRegistry , EditorExtensions } from 'vs/workbench/common/editor' ;
30
30
import { EditorInput } from 'vs/workbench/common/editor/editorInput' ;
31
31
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
32
- import { IWorkspaceContextService , WorkbenchState } from 'vs/platform/workspace/common/workspace' ;
32
+ import { IWorkspaceContextService , IWorkspaceFoldersWillChangeEvent , WorkbenchState } from 'vs/platform/workspace/common/workspace' ;
33
33
import { IExtensionService } from 'vs/workbench/services/extensions/common/extensions' ;
34
34
import { isWeb } from 'vs/base/common/platform' ;
35
35
import { IsWebContext } from 'vs/platform/contextkey/common/contextkeys' ;
@@ -279,10 +279,10 @@ export class WorkspaceTrustUXHandler extends Disposable implements IWorkbenchCon
279
279
if ( ! this . workspaceTrustEnablementService . isWorkspaceTrustEnabled ( ) ) {
280
280
return ;
281
281
}
282
- const trusted = this . workspaceTrustManagementService . isWorkspaceTrusted ( ) ;
283
282
284
- // eslint-disable-next-line no-async-promise-executor
285
- return e . join ( new Promise ( async resolve => {
283
+ const addWorkspaceFolder = async ( e : IWorkspaceFoldersWillChangeEvent ) : Promise < void > => {
284
+ const trusted = this . workspaceTrustManagementService . isWorkspaceTrusted ( ) ;
285
+
286
286
// Workspace is trusted and there are added/changed folders
287
287
if ( trusted && ( e . changes . added . length || e . changes . changed . length ) ) {
288
288
const addedFoldersTrustInfo = await Promise . all ( e . changes . added . map ( folder => this . workspaceTrustManagementService . getUriTrustInfo ( folder . uri ) ) ) ;
@@ -305,13 +305,11 @@ export class WorkspaceTrustUXHandler extends Disposable implements IWorkbenchCon
305
305
306
306
// Mark added/changed folders as trusted
307
307
await this . workspaceTrustManagementService . setUrisTrust ( addedFoldersTrustInfo . map ( i => i . uri ) , result . choice === 0 ) ;
308
-
309
- resolve ( ) ;
310
308
}
311
309
}
310
+ } ;
312
311
313
- resolve ( ) ;
314
- } ) ) ;
312
+ return e . join ( addWorkspaceFolder ( e ) ) ;
315
313
} ) ) ;
316
314
317
315
this . _register ( this . workspaceTrustManagementService . onDidChangeTrust ( trusted => {
0 commit comments