Skip to content

Commit dc3fa6c

Browse files
authored
Merge pull request #811 from CodinGame/fix-default-configuration-ignored
Fix default configuration being ignored
2 parents d7c82d2 + c28eaf5 commit dc3fa6c

4 files changed

Lines changed: 95 additions & 4 deletions

File tree

demo/src/setup.common.ts

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ import getWorkspaceTrustOverride from '@codingame/monaco-vscode-workspace-trust-
5252
import getLogServiceOverride from '@codingame/monaco-vscode-log-service-override'
5353
import getWorkingCopyServiceOverride from '@codingame/monaco-vscode-working-copy-service-override'
5454
import getTestingServiceOverride from '@codingame/monaco-vscode-testing-service-override'
55-
import getChatServiceOverride from '@codingame/monaco-vscode-chat-service-override'
55+
import getChatServiceOverride, {
56+
ChatEntitlement
57+
} from '@codingame/monaco-vscode-chat-service-override'
5658
import getNotebookServiceOverride from '@codingame/monaco-vscode-notebook-service-override'
5759
import getWelcomeServiceOverride from '@codingame/monaco-vscode-welcome-service-override'
5860
import getWalkThroughServiceOverride from '@codingame/monaco-vscode-walkthrough-service-override'
@@ -433,7 +435,21 @@ export const commonServices: IEditorOverrideServices = {
433435
...getLanguageDetectionWorkerServiceOverride(),
434436
...getStorageServiceOverride({
435437
fallbackOverride: {
436-
'workbench.activity.showAccounts': false
438+
'workbench.activity.showAccounts': false,
439+
/**
440+
* VSCode stores in its storage the chat setup state
441+
* We need it to be configured out of the box, with is not supported by VSCode
442+
* Except if we set the desired state in its storage directly, then it will work as if the user had set it up already
443+
*/
444+
'chat.setupContext': {
445+
entitlement: ChatEntitlement.Enterprise,
446+
organisations: undefined,
447+
sku: undefined,
448+
copilotTrackingId: undefined,
449+
registered: true,
450+
completed: true,
451+
installed: true
452+
}
437453
}
438454
}),
439455
...getRemoteAgentServiceOverride({ scanRemoteExtensions: true }),

src/service-override/chat.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ import { ILanguageModelIgnoredFilesService } from 'vs/workbench/contrib/chat/com
4141
import { IChatMarkdownAnchorService } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.service'
4242
import { ChatMarkdownAnchorService } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService'
4343
import { ChatEditingService } from 'vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl'
44-
import { ChatEntitlementService } from 'vs/workbench/services/chat/common/chatEntitlementService'
44+
import {
45+
ChatEntitlementService,
46+
ChatEntitlement
47+
} from 'vs/workbench/services/chat/common/chatEntitlementService'
4548
import { PromptsService } from 'vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl'
4649
import { IChatEntitlementService } from 'vs/workbench/services/chat/common/chatEntitlementService.service'
4750
import { IPromptsService } from 'vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service'
@@ -410,4 +413,4 @@ export default function getServiceOverride({
410413
}
411414
}
412415

413-
export type { IDefaultAccount }
416+
export { type IDefaultAccount, ChatEntitlement }
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= <loic@coderpad.io>
3+
Date: Thu, 18 Jun 2026 14:21:14 +0200
4+
Subject: [PATCH] fix: make default configuration scope rely on the hash of the
5+
default configuration
6+
7+
so that if the default configuration changes, it's not completely ignored at first
8+
---
9+
.../services/configuration/browser/configuration.ts | 6 ++++--
10+
1 file changed, 4 insertions(+), 2 deletions(-)
11+
12+
diff --git a/src/vs/workbench/services/configuration/browser/configuration.ts b/src/vs/workbench/services/configuration/browser/configuration.ts
13+
index a83c04f4d13..0a9e654bf24 100644
14+
--- a/src/vs/workbench/services/configuration/browser/configuration.ts
15+
+++ b/src/vs/workbench/services/configuration/browser/configuration.ts
16+
@@ -45,8 +45,10 @@ export class DefaultConfiguration extends BaseDefaultConfiguration {
17+
) {
18+
super(logService);
19+
this.cacheKey = { type: 'defaults', key: `${cacheScope}-configurationDefaultsOverrides` };
20+
- if (environmentService.options?.configurationDefaults) {
21+
- this.configurationRegistry.registerDefaultConfigurations([{ overrides: environmentService.options.configurationDefaults as IStringDictionary<IStringDictionary<unknown>> }]);
22+
+ const configurationDefaults = environmentService.options?.configurationDefaults;
23+
+ if (configurationDefaults) {
24+
+ this.configurationRegistry.registerDefaultConfigurations([{ overrides: configurationDefaults as IStringDictionary<IStringDictionary<unknown>> }]);
25+
+ this.cacheKey = { type: 'defaults', key: `${cacheScope}-${hash(configurationDefaults).toString(16)}-configurationDefaultsOverrides` };
26+
}
27+
}
28+
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= <loic@coderpad.io>
3+
Date: Thu, 18 Jun 2026 14:22:52 +0200
4+
Subject: [PATCH] fix: remove useless check that prevents ai-assist from being
5+
open by default on web mode
6+
7+
---
8+
src/vs/workbench/browser/layout.ts | 9 ++-------
9+
1 file changed, 2 insertions(+), 7 deletions(-)
10+
11+
diff --git a/src/vs/workbench/browser/layout.ts b/src/vs/workbench/browser/layout.ts
12+
index 6c141511d50..c1086090eeb 100644
13+
--- a/src/vs/workbench/browser/layout.ts
14+
+++ b/src/vs/workbench/browser/layout.ts
15+
@@ -695,7 +695,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
16+
private initLayoutState(lifecycleService: ILifecycleService, fileService: IFileService): void {
17+
this._mainContainerDimension = getClientArea(this.parent, this.contextService.getWorkbenchState() === WorkbenchState.EMPTY ? DEFAULT_EMPTY_WINDOW_DIMENSIONS : DEFAULT_WORKSPACE_WINDOW_DIMENSIONS); // running with fallback to ensure no error is thrown (https://github.com/microsoft/vscode/issues/240242)
18+
19+
- this.stateModel = new LayoutStateModel(this.storageService, this.configurationService, this.contextService, this.environmentService);
20+
+ this.stateModel = new LayoutStateModel(this.storageService, this.configurationService, this.contextService);
21+
this.stateModel.load({
22+
mainContainerDimension: this._mainContainerDimension,
23+
resetLayout: Boolean(this.layoutOptions?.resetLayout)
24+
@@ -2881,8 +2881,7 @@ class LayoutStateModel extends Disposable {
25+
constructor(
26+
private readonly storageService: IStorageService,
27+
private readonly configurationService: IConfigurationService,
28+
- private readonly contextService: IWorkspaceContextService,
29+
- private readonly environmentService: IBrowserWorkbenchEnvironmentService,
30+
+ private readonly contextService: IWorkspaceContextService
31+
) {
32+
super();
33+
34+
@@ -2953,10 +2952,6 @@ class LayoutStateModel extends Disposable {
35+
LayoutStateKeys.SIDEBAR_HIDDEN.defaultValue = workbenchState === WorkbenchState.EMPTY || auxiliaryBarForceMaximized === true;
36+
LayoutStateKeys.AUXILIARYBAR_SIZE.defaultValue = auxiliaryBarForceMaximized ? Math.max(300, mainContainerDimension.width / 2) : Math.min(300, mainContainerDimension.width / 4);
37+
LayoutStateKeys.AUXILIARYBAR_HIDDEN.defaultValue = (() => {
38+
- if (isWeb && !this.environmentService.remoteAuthority) {
39+
- return true; // not required in web if unsupported
40+
- }
41+
-
42+
if (auxiliaryBarForceMaximized === true) {
43+
return false; // forced to be visible
44+
}

0 commit comments

Comments
 (0)