Skip to content

Commit

Permalink
Chat welcome view never dismisses when in an untrusted workspace (fix m…
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero authored Jan 8, 2025
1 parent 33f3b65 commit 2569d71
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions src/vs/workbench/contrib/chat/browser/chatSetup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ import Severity from '../../../../base/common/severity.js';
import { IWorkbenchEnvironmentService } from '../../../services/environment/common/environmentService.js';
import { isWeb } from '../../../../base/common/platform.js';
import { ExtensionUrlHandlerOverrideRegistry } from '../../../services/extensions/browser/extensionUrlHandler.js';
import { IWorkspaceTrustRequestService } from '../../../../platform/workspace/common/workspaceTrust.js';

const defaultChat = {
extensionId: product.defaultChatAgent?.extensionId ?? '',
Expand Down Expand Up @@ -174,8 +175,7 @@ export class ChatSetupContribution extends Disposable implements IWorkbenchContr
ensureSideBarChatViewSize(400, viewDescriptorService, layoutService);

if (startSetup === true) {
const controller = that.controller.value;
controller.setup();
that.controller.value.setup();
}

configurationService.updateValue('chat.commandCenter.enabled', true);
Expand Down Expand Up @@ -728,7 +728,8 @@ class ChatSetupController extends Disposable {
@IChatAgentService private readonly chatAgentService: IChatAgentService,
@IActivityService private readonly activityService: IActivityService,
@ICommandService private readonly commandService: ICommandService,
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService
@IWorkbenchLayoutService private readonly layoutService: IWorkbenchLayoutService,
@IWorkspaceTrustRequestService private readonly workspaceTrustRequestService: IWorkspaceTrustRequestService
) {
super();

Expand Down Expand Up @@ -792,6 +793,13 @@ class ChatSetupController extends Disposable {
}
}

const trusted = await this.workspaceTrustRequestService.requestWorkspaceTrust({
message: localize('copilotWorkspaceTrust', "Copilot is currently only supported in trusted workspaces.")
});
if (!trusted) {
return;
}

const activeElement = getActiveElement();

// Install
Expand Down

0 comments on commit 2569d71

Please sign in to comment.