Skip to content

Commit af497b4

Browse files
authored
activate remote fsp before resolving trust (microsoft#165941)
fixes microsoft#161362
1 parent 9d0a7c4 commit af497b4

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/vs/workbench/browser/web.main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ export class BrowserMain extends Disposable {
331331
const workspaceTrustEnablementService = new WorkspaceTrustEnablementService(configurationService, environmentService);
332332
serviceCollection.set(IWorkspaceTrustEnablementService, workspaceTrustEnablementService);
333333

334-
const workspaceTrustManagementService = new WorkspaceTrustManagementService(configurationService, remoteAuthorityResolverService, storageService, uriIdentityService, environmentService, configurationService, workspaceTrustEnablementService);
334+
const workspaceTrustManagementService = new WorkspaceTrustManagementService(configurationService, remoteAuthorityResolverService, storageService, uriIdentityService, environmentService, configurationService, workspaceTrustEnablementService, fileService);
335335
serviceCollection.set(IWorkspaceTrustManagementService, workspaceTrustManagementService);
336336

337337
// Update workspace trust so that configuration is updated accordingly

src/vs/workbench/electron-sandbox/desktop.main.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export class DesktopMain extends Disposable {
289289
const workspaceTrustEnablementService = new WorkspaceTrustEnablementService(configurationService, environmentService);
290290
serviceCollection.set(IWorkspaceTrustEnablementService, workspaceTrustEnablementService);
291291

292-
const workspaceTrustManagementService = new WorkspaceTrustManagementService(configurationService, remoteAuthorityResolverService, storageService, uriIdentityService, environmentService, configurationService, workspaceTrustEnablementService);
292+
const workspaceTrustManagementService = new WorkspaceTrustManagementService(configurationService, remoteAuthorityResolverService, storageService, uriIdentityService, environmentService, configurationService, workspaceTrustEnablementService, fileService);
293293
serviceCollection.set(IWorkspaceTrustManagementService, workspaceTrustManagementService);
294294

295295
// Update workspace trust so that configuration is updated accordingly

src/vs/workbench/services/workspaces/common/workspaceTrust.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/
2222
import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity';
2323
import { isEqualAuthority } from 'vs/base/common/resources';
2424
import { isWeb } from 'vs/base/common/platform';
25+
import { IFileService } from 'vs/platform/files/common/files';
2526

2627
export const WORKSPACE_TRUST_ENABLED = 'security.workspace.trust.enabled';
2728
export const WORKSPACE_TRUST_STARTUP_PROMPT = 'security.workspace.trust.startupPrompt';
@@ -118,7 +119,8 @@ export class WorkspaceTrustManagementService extends Disposable implements IWork
118119
@IUriIdentityService private readonly uriIdentityService: IUriIdentityService,
119120
@IWorkbenchEnvironmentService private readonly environmentService: IWorkbenchEnvironmentService,
120121
@IWorkspaceContextService private readonly workspaceService: IWorkspaceContextService,
121-
@IWorkspaceTrustEnablementService private readonly workspaceTrustEnablementService: IWorkspaceTrustEnablementService
122+
@IWorkspaceTrustEnablementService private readonly workspaceTrustEnablementService: IWorkspaceTrustEnablementService,
123+
@IFileService private readonly fileService: IFileService
122124
) {
123125
super();
124126

@@ -164,6 +166,7 @@ export class WorkspaceTrustManagementService extends Disposable implements IWork
164166
this.remoteAuthorityResolverService.resolveAuthority(this.environmentService.remoteAuthority)
165167
.then(async result => {
166168
this._remoteAuthority = result;
169+
await this.fileService.activateProvider(Schemas.vscodeRemote);
167170
await this.updateWorkspaceTrust();
168171
})
169172
.finally(() => {

0 commit comments

Comments
 (0)