From 428752839216ae7a8be5bc8e0482ff762047ebb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:20:00 +0200 Subject: [PATCH 01/35] fix: apply patches also on session part of the VSCode codebase --- ...-classes-and-make-some-methods-acces.patch | 276 +++++++++++++--- ...-fix-just-use-regular-dynamic-import.patch | 35 ++- ...-style-to-help-extractService-script.patch | 16 +- .../0056-fix-break-cyclic-dependency.patch | 19 +- ...element-creation-to-be-able-to-creat.patch | 294 +++++++++++++++++- ...02-refactor-move-interface-in-common.patch | 15 +- 6 files changed, 595 insertions(+), 60 deletions(-) diff --git a/vscode-patches/0011-feat-export-some-classes-and-make-some-methods-acces.patch b/vscode-patches/0011-feat-export-some-classes-and-make-some-methods-acces.patch index 8c1f1799..2ad35de8 100644 --- a/vscode-patches/0011-feat-export-some-classes-and-make-some-methods-acces.patch +++ b/vscode-patches/0011-feat-export-some-classes-and-make-some-methods-acces.patch @@ -4,52 +4,60 @@ Date: Mon, 11 Mar 2024 17:32:31 +0100 Subject: [PATCH] feat: export some classes and make some methods accessible --- - .../editorState/browser/keybindingCancellation.ts | 6 ++++-- - .../gotoError/browser/markerNavigationService.ts | 2 +- - .../contrib/gotoSymbol/browser/symbolNavigation.ts | 2 +- - .../inlayHints/browser/inlayHintsController.ts | 2 +- - src/vs/editor/contrib/peekView/browser/peekView.ts | 6 ++++-- - .../actions/browser/actionViewItemService.ts | 2 +- - .../browser/extensionResourceLoaderService.ts | 2 +- - src/vs/platform/files/common/fileService.ts | 6 +++--- - .../sandbox/browser/sandboxHelperService.ts | 2 +- - .../api/browser/statusBarExtensionPoint.ts | 2 +- - src/vs/workbench/browser/layout.ts | 10 +++++----- - src/vs/workbench/browser/workbench.ts | 14 +++++++------- - .../agentHostSessionWorkingDirectoryResolver.ts | 2 +- - .../aiCustomizationWorkspaceService.ts | 2 +- - .../aiCustomization/customizationHarnessService.ts | 2 +- - .../browser/chatStatus/chatStatusItemService.ts | 2 +- - .../chatContentParts/chatTextEditContentPart.ts | 6 +++--- - .../browser/widget/input/chatInputNoticeHub.ts | 2 +- - .../widget/input/chatInputNotificationService.ts | 2 +- - .../widget/input/chatPhoneInputPresenter.ts | 2 +- - .../debug/browser/extensionHostDebugService.ts | 2 +- - .../browser/renameSymbolTrackerService.ts | 2 +- - .../contrib/issue/browser/issueTroubleshoot.ts | 6 +++--- - .../agentHost/browser/agentSdkSetupService.ts | 2 +- - .../agentHost/common/agentHostFileSystemService.ts | 2 +- - .../dialogs/browser/abstractFileDialogService.ts | 2 +- - .../services/dialogs/browser/fileDialogService.ts | 4 ++-- - .../extensionManagement/browser/extensionBisect.ts | 2 +- - .../browser/extensionGalleryManifestService.ts | 2 +- - .../common/extensionFeaturesManagemetService.ts | 2 +- - .../extensions/browser/extensionService.ts | 6 +++--- - .../extensions/browser/extensionUrlHandler.ts | 2 +- - .../extensions/browser/webWorkerExtensionHost.ts | 2 +- - .../extensions/common/abstractExtensionService.ts | 10 +++++----- - .../keybinding/browser/keybindingService.ts | 2 +- - .../languageStatus/common/languageStatusService.ts | 2 +- - .../services/localization/browser/localeService.ts | 2 +- - .../services/log/common/defaultLogLevels.ts | 2 +- - .../services/outline/browser/outlineService.ts | 2 +- - .../workbench/services/path/browser/pathService.ts | 2 +- - .../remote/common/remoteExplorerService.ts | 2 +- - .../remote/common/remoteExtensionsScanner.ts | 2 +- - .../terminal/common/embedderTerminalService.ts | 2 +- - .../common/remoteUserDataProfiles.ts | 2 +- - .../userDataSync/common/userDataSyncUtil.ts | 2 +- - 45 files changed, 74 insertions(+), 70 deletions(-) + .../browser/keybindingCancellation.ts | 6 ++++-- + .../browser/markerNavigationService.ts | 2 +- + .../gotoSymbol/browser/symbolNavigation.ts | 2 +- + .../inlayHints/browser/inlayHintsController.ts | 2 +- + .../contrib/peekView/browser/peekView.ts | 6 ++++-- + .../actions/browser/actionViewItemService.ts | 2 +- + .../browser/extensionResourceLoaderService.ts | 2 +- + src/vs/platform/files/common/fileService.ts | 6 +++--- + .../sandbox/browser/sandboxHelperService.ts | 2 +- + src/vs/sessions/browser/workbench.ts | 18 +++++++++--------- + .../browser/account.contribution.ts | 2 +- + .../nullAgentFeedbackService.contribution.ts | 2 +- + .../browser/nullInlineChatSessionService.ts | 2 +- + .../browser/sessionChatInputToolbarDebug.ts | 2 +- + .../webTunnelAgentHostService.contribution.ts | 2 +- + .../sessions/browser/sessionContext.ts | 2 +- + .../browser/sessionsProvidersService.ts | 2 +- + .../api/browser/statusBarExtensionPoint.ts | 2 +- + src/vs/workbench/browser/layout.ts | 10 +++++----- + src/vs/workbench/browser/workbench.ts | 14 +++++++------- + ...agentHostSessionWorkingDirectoryResolver.ts | 2 +- + .../aiCustomizationWorkspaceService.ts | 2 +- + .../customizationHarnessService.ts | 2 +- + .../chatStatus/chatStatusItemService.ts | 2 +- + .../chatTextEditContentPart.ts | 6 +++--- + .../browser/widget/input/chatInputNoticeHub.ts | 2 +- + .../input/chatInputNotificationService.ts | 2 +- + .../widget/input/chatPhoneInputPresenter.ts | 2 +- + .../debug/browser/extensionHostDebugService.ts | 2 +- + .../browser/renameSymbolTrackerService.ts | 2 +- + .../contrib/issue/browser/issueTroubleshoot.ts | 6 +++--- + .../agentHost/browser/agentSdkSetupService.ts | 2 +- + .../common/agentHostFileSystemService.ts | 2 +- + .../browser/abstractFileDialogService.ts | 2 +- + .../dialogs/browser/fileDialogService.ts | 4 ++-- + .../browser/extensionBisect.ts | 2 +- + .../browser/extensionGalleryManifestService.ts | 2 +- + .../extensionFeaturesManagemetService.ts | 2 +- + .../extensions/browser/extensionService.ts | 6 +++--- + .../extensions/browser/extensionUrlHandler.ts | 2 +- + .../browser/webWorkerExtensionHost.ts | 2 +- + .../common/abstractExtensionService.ts | 10 +++++----- + .../keybinding/browser/keybindingService.ts | 2 +- + .../common/languageStatusService.ts | 2 +- + .../localization/browser/localeService.ts | 2 +- + .../services/log/common/defaultLogLevels.ts | 2 +- + .../services/outline/browser/outlineService.ts | 2 +- + .../services/path/browser/pathService.ts | 2 +- + .../remote/common/remoteExplorerService.ts | 2 +- + .../remote/common/remoteExtensionsScanner.ts | 2 +- + .../terminal/common/embedderTerminalService.ts | 2 +- + .../common/remoteUserDataProfiles.ts | 2 +- + .../userDataSync/common/userDataSyncUtil.ts | 2 +- + 53 files changed, 90 insertions(+), 86 deletions(-) diff --git a/src/vs/editor/contrib/editorState/browser/keybindingCancellation.ts b/src/vs/editor/contrib/editorState/browser/keybindingCancellation.ts index 94020ce96b9..de1e9af237e 100644 @@ -194,6 +202,182 @@ index 00394e44052..42a6ea8aec3 100644 declare readonly _serviceBrand: undefined; async checkSandboxDependencies(): Promise { +diff --git a/src/vs/sessions/browser/workbench.ts b/src/vs/sessions/browser/workbench.ts +index b07fe047914..6b73a61171f 100644 +--- a/src/vs/sessions/browser/workbench.ts ++++ b/src/vs/sessions/browser/workbench.ts +@@ -471,7 +471,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic + private editorService!: IEditorService; + private paneCompositeService!: IPaneCompositePartService; + private viewDescriptorService!: IViewDescriptorService; +- private sessionsService!: ISessionsService; ++ protected sessionsService!: ISessionsService; + private sessionsPartService!: ISessionsPartService; + private customViewService!: ICustomViewService; + private customViewGridPartService!: ICustomViewGridPartService; +@@ -484,7 +484,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic + protected readonly parent: HTMLElement, + private readonly options: IWorkbenchOptions | undefined, + private readonly serviceCollection: ServiceCollection, +- private readonly logService: ILogService ++ protected readonly logService: ILogService + ) { + super(); + +@@ -516,7 +516,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic + + //#region Error Handling + +- private registerErrorHandler(logService: ILogService): void { ++ protected registerErrorHandler(logService: ILogService): void { + // Increase stack trace limit for better errors stacks + if (!isFirefox) { + Error.stackTraceLimit = 100; +@@ -538,7 +538,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic + } + + private previousUnexpectedError: { message: string | undefined; time: number } = { message: undefined, time: 0 }; +- private handleUnexpectedError(error: unknown, logService: ILogService): void { ++ protected handleUnexpectedError(error: unknown, logService: ILogService): void { + const message = toErrorMessage(error, true); + if (!message) { + return; +@@ -670,7 +670,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic + }); + } + +- private initServices(serviceCollection: ServiceCollection): IInstantiationService { ++ protected initServices(serviceCollection: ServiceCollection): IInstantiationService { + // Layout Service + serviceCollection.set(IAgentWorkbenchLayoutService, this); + +@@ -1036,7 +1036,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic + } + } + +- private createNotificationsHandlers( ++ protected createNotificationsHandlers( + instantiationService: IInstantiationService, + notificationService: NotificationService + ): void { +@@ -1073,7 +1073,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic + }); + } + +- private registerNotificationRowHeight(): void { ++ protected registerNotificationRowHeight(): void { + this._register(autorun(reader => { + setNotificationRowHeight(this.layoutPolicy.isPhoneLayout.read(reader) ? PHONE_NOTIFICATION_ROW_HEIGHT : COMPACT_NOTIFICATION_ROW_HEIGHT); + })); +@@ -1165,7 +1165,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic + this.mainContainer.appendChild(customViewGridPartContainer); + } + +- private restore(lifecycleService: ILifecycleService): void { ++ protected restore(lifecycleService: ILifecycleService): void { + // Update perf marks + mark('code/didStartWorkbench'); + performance.measure('perf: workbench create & restore', 'code/didLoadWorkbenchMain', 'code/didStartWorkbench'); +@@ -1191,7 +1191,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic + eventuallyPhaseScheduler.schedule(); + } + +- private restoreParts(): void { ++ protected restoreParts(): void { + // Open default view containers for each visible part + const partsToRestore: { location: ViewContainerLocation; visible: boolean }[] = [ + { location: ViewContainerLocation.Sidebar, visible: this.partVisibility.sidebar }, +diff --git a/src/vs/sessions/contrib/accountMenu/browser/account.contribution.ts b/src/vs/sessions/contrib/accountMenu/browser/account.contribution.ts +index 41e9af727ea..301da3430ed 100644 +--- a/src/vs/sessions/contrib/accountMenu/browser/account.contribution.ts ++++ b/src/vs/sessions/contrib/accountMenu/browser/account.contribution.ts +@@ -1048,7 +1048,7 @@ registerWorkbenchContribution2(AccountWidgetContribution.ID, AccountWidgetContri + + // --- Chat Dashboard Service (real implementation for mobile account sheet) --- // + +-class ChatDashboardServiceImpl implements IChatDashboardService { ++export class ChatDashboardServiceImpl implements IChatDashboardService { + readonly _serviceBrand: undefined; + + constructor( +diff --git a/src/vs/sessions/contrib/agentFeedback/browser/nullAgentFeedbackService.contribution.ts b/src/vs/sessions/contrib/agentFeedback/browser/nullAgentFeedbackService.contribution.ts +index 23f2cbb0f24..f6852c3edc9 100644 +--- a/src/vs/sessions/contrib/agentFeedback/browser/nullAgentFeedbackService.contribution.ts ++++ b/src/vs/sessions/contrib/agentFeedback/browser/nullAgentFeedbackService.contribution.ts +@@ -20,7 +20,7 @@ import { IFeedbackPullRequest } from '../../../../platform/agentHost/common/meta + * is not wired up. The changes view model still depends on the service + * being registered, so we expose a service that reports no feedback. + */ +-class NullAgentFeedbackService extends Disposable implements IAgentFeedbackService { ++export class NullAgentFeedbackService extends Disposable implements IAgentFeedbackService { + + declare readonly _serviceBrand: undefined; + +diff --git a/src/vs/sessions/contrib/chat/browser/nullInlineChatSessionService.ts b/src/vs/sessions/contrib/chat/browser/nullInlineChatSessionService.ts +index 6f8b31a16eb..3858274d402 100644 +--- a/src/vs/sessions/contrib/chat/browser/nullInlineChatSessionService.ts ++++ b/src/vs/sessions/contrib/chat/browser/nullInlineChatSessionService.ts +@@ -10,7 +10,7 @@ import { IActiveCodeEditor, ICodeEditor } from '../../../../editor/browser/edito + import { InstantiationType, registerSingleton } from '../../../../platform/instantiation/common/extensions.js'; + import { IInlineChatSession, IInlineChatSessionService } from '../../../../workbench/contrib/inlineChat/browser/inlineChatSessionService.js'; + +-class NullInlineChatSessionService implements IInlineChatSessionService { ++export class NullInlineChatSessionService implements IInlineChatSessionService { + declare _serviceBrand: undefined; + + readonly onWillStartSession: Event = Event.None; +diff --git a/src/vs/sessions/contrib/chat/browser/sessionChatInputToolbarDebug.ts b/src/vs/sessions/contrib/chat/browser/sessionChatInputToolbarDebug.ts +index 86cdb731232..7037624242e 100644 +--- a/src/vs/sessions/contrib/chat/browser/sessionChatInputToolbarDebug.ts ++++ b/src/vs/sessions/contrib/chat/browser/sessionChatInputToolbarDebug.ts +@@ -80,7 +80,7 @@ export function isNonNegativeIntegerInput(raw: string): boolean { + return Number.isInteger(parsed) && parsed >= 0; + } + +-class SessionChatPillsDebugService extends Disposable implements ISessionChatPillsDebugService { ++export class SessionChatPillsDebugService extends Disposable implements ISessionChatPillsDebugService { + + declare readonly _serviceBrand: undefined; + +diff --git a/src/vs/sessions/contrib/providers/remoteAgentHost/browser/webTunnelAgentHostService.contribution.ts b/src/vs/sessions/contrib/providers/remoteAgentHost/browser/webTunnelAgentHostService.contribution.ts +index 6db0669ae06..b81b2df791e 100644 +--- a/src/vs/sessions/contrib/providers/remoteAgentHost/browser/webTunnelAgentHostService.contribution.ts ++++ b/src/vs/sessions/contrib/providers/remoteAgentHost/browser/webTunnelAgentHostService.contribution.ts +@@ -23,7 +23,7 @@ import { WebTunnelAgentHostService } from './webTunnelAgentHostService.js'; + /** + * Selects the embedder proxy when provided and otherwise connects directly from the browser. + */ +-class BrowserTunnelAgentHostServiceSelector extends Disposable implements ITunnelAgentHostService { ++export class BrowserTunnelAgentHostServiceSelector extends Disposable implements ITunnelAgentHostService { + declare readonly _serviceBrand: undefined; + + private readonly _delegate: ITunnelAgentHostService; +diff --git a/src/vs/sessions/services/sessions/browser/sessionContext.ts b/src/vs/sessions/services/sessions/browser/sessionContext.ts +index 762a1979eb3..0445c805938 100644 +--- a/src/vs/sessions/services/sessions/browser/sessionContext.ts ++++ b/src/vs/sessions/services/sessions/browser/sessionContext.ts +@@ -52,7 +52,7 @@ export class SessionContext implements ISessionContext { + * Global fallback used outside a scoped surface. Reports the window's active + * session. + */ +-class ActiveSessionContext implements ISessionContext { ++export class ActiveSessionContext implements ISessionContext { + + declare readonly _serviceBrand: undefined; + +diff --git a/src/vs/sessions/services/sessions/browser/sessionsProvidersService.ts b/src/vs/sessions/services/sessions/browser/sessionsProvidersService.ts +index bde3770661b..d1f01d8d1d2 100644 +--- a/src/vs/sessions/services/sessions/browser/sessionsProvidersService.ts ++++ b/src/vs/sessions/services/sessions/browser/sessionsProvidersService.ts +@@ -30,7 +30,7 @@ export interface ISessionsProvidersService { + getProvider(providerId: string): T | undefined; + } + +-class SessionsProvidersService extends Disposable implements ISessionsProvidersService { ++export class SessionsProvidersService extends Disposable implements ISessionsProvidersService { + declare readonly _serviceBrand: undefined; + + private readonly _providers = new Map(); diff --git a/src/vs/workbench/api/browser/statusBarExtensionPoint.ts b/src/vs/workbench/api/browser/statusBarExtensionPoint.ts index c8d1765a7ab..91d78dc1be0 100644 --- a/src/vs/workbench/api/browser/statusBarExtensionPoint.ts diff --git a/vscode-patches/0044-fix-just-use-regular-dynamic-import.patch b/vscode-patches/0044-fix-just-use-regular-dynamic-import.patch index 1137ffd4..b2d66a45 100644 --- a/vscode-patches/0044-fix-just-use-regular-dynamic-import.patch +++ b/vscode-patches/0044-fix-just-use-regular-dynamic-import.patch @@ -4,9 +4,40 @@ Date: Wed, 30 Oct 2024 15:01:33 +0100 Subject: [PATCH] fix: just use regular dynamic import --- - .../services/keybinding/browser/keyboardLayoutService.ts | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) + .../remoteAgentHost/browser/devTunnelsWebLoader.ts | 9 ++------- + .../services/keybinding/browser/keyboardLayoutService.ts | 3 +-- + 2 files changed, 3 insertions(+), 9 deletions(-) +diff --git a/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devTunnelsWebLoader.ts b/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devTunnelsWebLoader.ts +index 4a11f016697..4941264d3dc 100644 +--- a/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devTunnelsWebLoader.ts ++++ b/src/vs/sessions/contrib/providers/remoteAgentHost/browser/devTunnelsWebLoader.ts +@@ -5,12 +5,9 @@ + + import type { TunnelRelayTunnelClient } from '@microsoft/dev-tunnels-connections'; + import type { TunnelManagementHttpClient } from '@microsoft/dev-tunnels-management'; +-import { AppResourcePath, FileAccess } from '../../../../../base/common/network.js'; + import type { ITunnelDescriptor } from '../../../../../platform/agentHost/common/tunnelAgentHostConnector.js'; + import type { ITunnelDuplexStream } from '../../../../../platform/agentHost/common/tunnelMessageSocket.js'; + +-const devTunnelsWebBundlePath: AppResourcePath = 'vs/sessions/contrib/providers/remoteAgentHost/browser/devTunnelsModule.js'; +- + /** The subset of tunnel metadata consumed by the browser management and relay adapters. */ + export interface IDevTunnelsWebTunnel extends ITunnelDescriptor { + readonly endpoints?: object; +@@ -79,10 +76,8 @@ let devTunnelsWeb: Promise | undefined; + /** Loads the browser-compatible Dev Tunnels SDK bundle on first use. */ + export function loadDevTunnelsWeb(): Promise { + devTunnelsWeb ??= (async () => { +- // This generated browser-only module is emitted beside its loader. +- const devTunnelsWebUrl = FileAccess.asBrowserUri(devTunnelsWebBundlePath).toString(true); +- // Keep the URL runtime-resolved so bundlers do not rewrite the import. +- const module = await import(/* webpackIgnore: true */ /* @vite-ignore */ `${devTunnelsWebUrl}`) as IDevTunnelsWeb; ++ // @ts-ignore ++ const module = await import('./devTunnelsModule.js') as IDevTunnelsWeb; + return module; + })(); + return devTunnelsWeb; diff --git a/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.ts b/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.ts index f155e27685f..91c827ba5a9 100644 --- a/src/vs/workbench/services/keybinding/browser/keyboardLayoutService.ts diff --git a/vscode-patches/0054-fix-change-imort-style-to-help-extractService-script.patch b/vscode-patches/0054-fix-change-imort-style-to-help-extractService-script.patch index 31827c8e..4d17ba51 100644 --- a/vscode-patches/0054-fix-change-imort-style-to-help-extractService-script.patch +++ b/vscode-patches/0054-fix-change-imort-style-to-help-extractService-script.patch @@ -5,9 +5,10 @@ Subject: [PATCH] fix: change imort style to help extractService script --- .../browser/peek/referencesWidget.ts | 16 ++++---- + .../changes/browser/sessionChangesService.ts | 2 +- .../browser/callHierarchyPeek.ts | 40 +++++++++---------- .../browser/typeHierarchyPeek.ts | 18 ++++----- - 3 files changed, 37 insertions(+), 37 deletions(-) + 4 files changed, 38 insertions(+), 38 deletions(-) diff --git a/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.ts b/src/vs/editor/contrib/gotoSymbol/browser/peek/referencesWidget.ts index c6b40951477..e119067abd0 100644 @@ -74,6 +75,19 @@ index c6b40951477..e119067abd0 100644 }, dnd: this._instantiationService.createInstance(ReferencesDragAndDrop) }; +diff --git a/src/vs/sessions/contrib/changes/browser/sessionChangesService.ts b/src/vs/sessions/contrib/changes/browser/sessionChangesService.ts +index 13470144e0e..f2f71027535 100644 +--- a/src/vs/sessions/contrib/changes/browser/sessionChangesService.ts ++++ b/src/vs/sessions/contrib/changes/browser/sessionChangesService.ts +@@ -23,7 +23,7 @@ import { SessionChangesEditorInput } from './sessionChangesEditorInput.js'; + import { ISessionChangesEditorOptions, ISessionChangesService } from '../common/sessionChangesService.js'; + import { UNCOMMITTED_CHANGES_CHANGESET_ID } from '../../../services/sessions/common/session.js'; + +-export { ISessionChangesService } from '../common/sessionChangesService.js'; ++export { ISessionChangesService }; + export type { ISessionChangesEditorOptions } from '../common/sessionChangesService.js'; + + const CHANGES_MULTI_DIFF_SOURCE_SCHEME = 'changes-multi-diff-source'; diff --git a/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.ts b/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.ts index 75da6466a36..0b6eb76e2cc 100644 --- a/src/vs/workbench/contrib/callHierarchy/browser/callHierarchyPeek.ts diff --git a/vscode-patches/0056-fix-break-cyclic-dependency.patch b/vscode-patches/0056-fix-break-cyclic-dependency.patch index 8dad7b90..875bf755 100644 --- a/vscode-patches/0056-fix-break-cyclic-dependency.patch +++ b/vscode-patches/0056-fix-break-cyclic-dependency.patch @@ -4,14 +4,31 @@ Date: Mon, 10 Mar 2025 12:28:15 +0100 Subject: [PATCH] fix: break cyclic dependency --- + .../contrib/chat/browser/newChatContextAttachments.ts | 4 ++-- .../chatSandboxPrerequisiteConfirmationSubPart.ts | 2 +- .../contrib/tasks/browser/task.contribution.ts | 3 ++- .../contrib/tasks/browser/terminalTaskSystem.ts | 3 ++- src/vs/workbench/contrib/tasks/common/constants.ts | 11 +++++++++++ src/vs/workbench/contrib/tasks/common/tasks.ts | 9 +-------- - 5 files changed, 17 insertions(+), 11 deletions(-) + 6 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 src/vs/workbench/contrib/tasks/common/constants.ts +diff --git a/src/vs/sessions/contrib/chat/browser/newChatContextAttachments.ts b/src/vs/sessions/contrib/chat/browser/newChatContextAttachments.ts +index f7219710a68..94d9754a794 100644 +--- a/src/vs/sessions/contrib/chat/browser/newChatContextAttachments.ts ++++ b/src/vs/sessions/contrib/chat/browser/newChatContextAttachments.ts +@@ -38,9 +38,9 @@ import { DEFAULT_LABELS_CONTAINER, ResourceLabels } from '../../../../workbench/ + + import { IChatRequestVariableEntry, isAgentHostCompletionVariableEntry, isPastedTextArtifact, isStringVariableEntry, OmittedState, resolveChatContextIcon } from '../../../../workbench/contrib/chat/common/attachments/chatVariableEntries.js'; + import { isLocation } from '../../../../editor/common/languages.js'; +-import { resizeImage } from '../../../../workbench/contrib/chat/browser/chatImageUtils.js'; ++import { imageToHash, resizeImage } from '../../../../workbench/contrib/chat/browser/chatImageUtils.js'; + import { createImageHoverContent, openPastedTextArtifact } from '../../../../workbench/contrib/chat/browser/attachments/chatAttachmentWidgets.js'; +-import { imageToHash, isImage } from '../../../../workbench/contrib/chat/browser/widget/input/editor/chatPasteProviders.js'; ++import { isImage } from '../../../../workbench/contrib/chat/browser/widget/input/editor/chatPasteProviders.js'; + import { getExcludes, ISearchConfiguration, ISearchService, QueryType } from '../../../../workbench/services/search/common/search.js'; + import { createFileIconThemableTreeContainerScope } from '../../../../workbench/contrib/files/browser/views/explorerView.js'; + import { ADDITIONAL_REPOSITORY_CONTEXT_ID_PREFIX } from '../common/newChatContextIds.js'; diff --git a/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSandboxPrerequisiteConfirmationSubPart.ts b/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSandboxPrerequisiteConfirmationSubPart.ts index 9a9c423df9d..d48fdf2b0a2 100644 --- a/src/vs/workbench/contrib/chat/browser/widget/chatContentParts/toolInvocationParts/chatSandboxPrerequisiteConfirmationSubPart.ts diff --git a/vscode-patches/0069-feat-centralize-element-creation-to-be-able-to-creat.patch b/vscode-patches/0069-feat-centralize-element-creation-to-be-able-to-creat.patch index cdd2c8d4..062a1085 100644 --- a/vscode-patches/0069-feat-centralize-element-creation-to-be-able-to-creat.patch +++ b/vscode-patches/0069-feat-centralize-element-creation-to-be-able-to-creat.patch @@ -104,9 +104,20 @@ Subject: [PATCH] feat: centralize element creation, to be able to create them .../platform/domWidget/browser/domWidget.ts | 5 +- .../imageResize/browser/imageResizeService.ts | 3 +- .../markdown/browser/markdownRenderer.ts | 3 +- + .../mobile/contributions/mobileChangesView.ts | 2 +- + .../mobile/contributions/mobileDiffView.ts | 4 +- + .../contributions/mobileMultiDiffView.ts | 4 +- + .../parts/mobile/mobileTitlebarPart.ts | 4 +- + .../sessions/browser/parts/sessionHeader.ts | 4 +- src/vs/sessions/browser/workbench.ts | 12 ++--- .../browser/agentFeedbackEditorOverlay.ts | 3 +- - .../browser/sessionsPolicyBlocked.ts | 6 +-- + .../browser/feedbackInputWidget.ts | 12 ++--- + .../test/browser/agentsDiffEditor.fixture.ts | 4 +- + .../chat/browser/noAgentHostEmptyState.ts | 2 +- + .../github/browser/githubReferenceList.ts | 4 +- + .../contrib/github/browser/issueHover.ts | 4 +- + .../github/browser/pullRequestHover.ts | 4 +- + .../browser/sessionsPolicyBlocked.ts | 14 +++--- .../api/browser/mainThreadCodeInsets.ts | 4 +- .../browser/actions/developerActions.ts | 4 +- src/vs/workbench/browser/layout.ts | 4 +- @@ -227,7 +238,7 @@ Subject: [PATCH] feat: centralize element creation, to be able to create them .../host/browser/browserHostService.ts | 6 +-- .../componentFixtures/chat/renderChatInput.ts | 3 +- .../test/browser/workbenchTestServices.ts | 4 +- - 222 files changed, 718 insertions(+), 633 deletions(-) + 233 files changed, 746 insertions(+), 661 deletions(-) diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index 23e5038aa9c..97ccaf6663e 100644 @@ -3489,8 +3500,109 @@ index 1217633b485..030307e508f 100644 }; } +diff --git a/src/vs/sessions/browser/parts/mobile/contributions/mobileChangesView.ts b/src/vs/sessions/browser/parts/mobile/contributions/mobileChangesView.ts +index 0e6b66fc6d4..70bce79f543 100644 +--- a/src/vs/sessions/browser/parts/mobile/contributions/mobileChangesView.ts ++++ b/src/vs/sessions/browser/parts/mobile/contributions/mobileChangesView.ts +@@ -216,7 +216,7 @@ export class MobileChangesView extends Disposable { + DOM.append(this.subtitleEl, $('span.mobile-overlay-header-subtitle-files')).textContent = fileWord; + DOM.append(this.subtitleEl, $('span.mobile-overlay-header-subtitle-sep')).textContent = ' ยท '; + DOM.append(this.subtitleEl, $('span.mobile-changes-row-added')).textContent = `+${totalAdded}`; +- DOM.append(this.subtitleEl, document.createTextNode(' ')); ++ DOM.append(this.subtitleEl, DOM.createTextNode(' ')); + DOM.append(this.subtitleEl, $('span.mobile-changes-row-removed')).textContent = `-${totalRemoved}`; + + // Build the sibling list once so each row passes the same +diff --git a/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffView.ts b/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffView.ts +index d47658c7c90..9279ace3a41 100644 +--- a/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffView.ts ++++ b/src/vs/sessions/browser/parts/mobile/contributions/mobileDiffView.ts +@@ -304,7 +304,7 @@ export class MobileDiffView extends Disposable { + DOM.append(this.subtitleEl, $('span.mobile-changes-row-added')).textContent = `+${diff.added}`; + } + if (diff.added && diff.removed) { +- DOM.append(this.subtitleEl, document.createTextNode(' ')); ++ DOM.append(this.subtitleEl, DOM.createTextNode(' ')); + } + if (diff.removed) { + DOM.append(this.subtitleEl, $('span.mobile-changes-row-removed')).textContent = `-${diff.removed}`; +@@ -404,7 +404,7 @@ export class MobileDiffView extends Disposable { + // kept so both paths share the same container node. + const colorMap = TokenizationRegistry.getColorMap(); + if (colorMap && hasRealTokens) { +- const styleEl = document.createElement('style'); ++ const styleEl = DOM.createElement('style'); + styleEl.textContent = generateTokensCSSForColorMap(colorMap); + container.appendChild(styleEl); + } +diff --git a/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffView.ts b/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffView.ts +index 4810077c0ab..9c0d335734f 100644 +--- a/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffView.ts ++++ b/src/vs/sessions/browser/parts/mobile/contributions/mobileMultiDiffView.ts +@@ -869,7 +869,7 @@ export class MobileMultiDiffView extends Disposable { + + const colorMap = TokenizationRegistry.getColorMap(); + if (colorMap && state.renderData.hasRealTokens) { +- const styleEl = document.createElement('style'); ++ const styleEl = DOM.createElement('style'); + styleEl.textContent = generateTokensCSSForColorMap(colorMap); + inner.appendChild(styleEl); + } +@@ -928,7 +928,7 @@ export class MobileMultiDiffView extends Disposable { + htmlParts.push(this.renderBodyEntryHtml(index, state.renderData.bodyEntries[index], state.renderData.origLines, state.renderData.modLines)); + } + +- const template = document.createElement('template'); ++ const template = DOM.createElement('template'); + template.innerHTML = htmlParts.join(''); + const insertedElements = Array.from(template.content.children) as HTMLElement[]; + for (const element of insertedElements) { +diff --git a/src/vs/sessions/browser/parts/mobile/mobileTitlebarPart.ts b/src/vs/sessions/browser/parts/mobile/mobileTitlebarPart.ts +index 1bbf6fdfe54..25b36020ca3 100644 +--- a/src/vs/sessions/browser/parts/mobile/mobileTitlebarPart.ts ++++ b/src/vs/sessions/browser/parts/mobile/mobileTitlebarPart.ts +@@ -5,7 +5,7 @@ + + import './mobileChatShell.css'; + import { Disposable, DisposableStore, MutableDisposable, toDisposable } from '../../../../base/common/lifecycle.js'; +-import { $, addDisposableListener, append, EventType } from '../../../../base/browser/dom.js'; ++import { $, addDisposableListener, append, createElement, EventType } from '../../../../base/browser/dom.js'; + import { Emitter, Event } from '../../../../base/common/event.js'; + import { ThemeIcon } from '../../../../base/common/themables.js'; + import { Codicon } from '../../../../base/common/codicons.js'; +@@ -116,7 +116,7 @@ export class MobileTitlebarPart extends Disposable { + ) { + super(); + +- this.element = document.createElement('div'); ++ this.element = createElement('div'); + this.element.className = 'mobile-top-bar'; + + // Register DOM removal before appending so that any exception +diff --git a/src/vs/sessions/browser/parts/sessionHeader.ts b/src/vs/sessions/browser/parts/sessionHeader.ts +index 47cd222b00e..56ea77e5114 100644 +--- a/src/vs/sessions/browser/parts/sessionHeader.ts ++++ b/src/vs/sessions/browser/parts/sessionHeader.ts +@@ -6,7 +6,7 @@ + import './media/chatCompositeBar.css'; + import { Disposable, DisposableStore, MutableDisposable } from '../../../base/common/lifecycle.js'; + import { Emitter, Event } from '../../../base/common/event.js'; +-import { $, addDisposableGenericMouseDownListener, addDisposableListener, addStandardDisposableListener, DisposableResizeObserver, EventType, getWindow, isMouseEvent } from '../../../base/browser/dom.js'; ++import { $, addDisposableGenericMouseDownListener, addDisposableListener, addStandardDisposableListener, createElement, DisposableResizeObserver, EventType, getWindow, isMouseEvent } from '../../../base/browser/dom.js'; + import { StandardMouseEvent } from '../../../base/browser/mouseEvent.js'; + import { IKeyboardEvent } from '../../../base/browser/keyboardEvent.js'; + import { KeyCode } from '../../../base/common/keyCodes.js'; +@@ -335,7 +335,7 @@ export class SessionHeader extends Disposable { + // the user neither sees a blank field nor accidentally commits the fallback. + const fallbackTitle = getUntitledSessionTitle(session.isQuickChat?.get() ?? false); + +- const input = document.createElement('input'); ++ const input = createElement('input'); + input.type = 'text'; + input.className = 'chat-composite-bar-session-title-input'; + input.value = initialTitle; diff --git a/src/vs/sessions/browser/workbench.ts b/src/vs/sessions/browser/workbench.ts -index b07fe047914..44a86eb8747 100644 +index 6b73a61171f..550f622ac16 100644 --- a/src/vs/sessions/browser/workbench.ts +++ b/src/vs/sessions/browser/workbench.ts @@ -9,7 +9,7 @@ import './media/workbench.css'; @@ -3568,8 +3680,157 @@ index 29c64998764..69b53e8d6c2 100644 constructor( group: IAgentFeedbackOverlayEditorGroup, +diff --git a/src/vs/sessions/contrib/agentFeedback/browser/feedbackInputWidget.ts b/src/vs/sessions/contrib/agentFeedback/browser/feedbackInputWidget.ts +index 30ef37ccf8f..4804ffa3360 100644 +--- a/src/vs/sessions/contrib/agentFeedback/browser/feedbackInputWidget.ts ++++ b/src/vs/sessions/contrib/agentFeedback/browser/feedbackInputWidget.ts +@@ -5,7 +5,7 @@ + + import './media/agentFeedbackEditorInput.css'; + import { IContextMenuProvider } from '../../../../base/browser/contextmenu.js'; +-import { addStandardDisposableListener, ModifierKeyEmitter } from '../../../../base/browser/dom.js'; ++import { addStandardDisposableListener, createElement, ModifierKeyEmitter } from '../../../../base/browser/dom.js'; + import { status as announceStatus } from '../../../../base/browser/ui/aria/aria.js'; + import { ActionBar } from '../../../../base/browser/ui/actionbar/actionbar.js'; + import { ActionWithDropdownActionViewItem } from '../../../../base/browser/ui/dropdown/dropdownActionViewItem.js'; +@@ -82,11 +82,11 @@ export class FeedbackInputWidget extends Disposable { + constructor(private readonly _options: IFeedbackInputWidgetOptions) { + super(); + this._hasExplicitAriaLabel = _options.ariaLabel !== undefined; +- this.domNode = document.createElement('div'); ++ this.domNode = createElement('div'); + this.domNode.classList.add('agent-feedback-input-widget'); + this.domNode.style.display = 'none'; + +- this.inputElement = document.createElement('textarea'); ++ this.inputElement = createElement('textarea'); + this.inputElement.rows = 1; + this.inputElement.placeholder = _options.placeholder; + this.inputElement.setAttribute('aria-label', _options.ariaLabel ?? _options.placeholder); +@@ -94,17 +94,17 @@ export class FeedbackInputWidget extends Disposable { + this.domNode.appendChild(this.inputElement); + + // Hidden element used to measure text width for auto-growing +- this._measureElement = document.createElement('span'); ++ this._measureElement = createElement('span'); + this._measureElement.classList.add('agent-feedback-input-measure'); + this.domNode.appendChild(this._measureElement); + +- const actionsContainer = document.createElement('div'); ++ const actionsContainer = createElement('div'); + actionsContainer.classList.add('agent-feedback-input-actions'); + actionsContainer.style.height = `${FeedbackInputWidget._LINE_HEIGHT}px`; + this.domNode.appendChild(actionsContainer); + this._actionsContainer = actionsContainer; + +- this._busyIndicator = document.createElement('div'); ++ this._busyIndicator = createElement('div'); + this._busyIndicator.classList.add('agent-feedback-input-busy-indicator', ...ThemeIcon.asClassNameArray(Codicon.loading), 'codicon-modifier-spin'); + this._busyIndicator.setAttribute('aria-hidden', 'true'); + this._busyIndicator.style.display = 'none'; +diff --git a/src/vs/sessions/contrib/changes/test/browser/agentsDiffEditor.fixture.ts b/src/vs/sessions/contrib/changes/test/browser/agentsDiffEditor.fixture.ts +index 647788c946c..5cc1148600f 100644 +--- a/src/vs/sessions/contrib/changes/test/browser/agentsDiffEditor.fixture.ts ++++ b/src/vs/sessions/contrib/changes/test/browser/agentsDiffEditor.fixture.ts +@@ -6,7 +6,7 @@ + import '../../browser/media/sessionChangesEditor.css'; + import '../../../agentFeedback/browser/media/agentFeedbackEditorInput.css'; + import '../../../../../base/browser/ui/codicons/codiconStyles.js'; +-import { $, Dimension, getWindow } from '../../../../../base/browser/dom.js'; ++import { $, createTextNode, Dimension, getWindow } from '../../../../../base/browser/dom.js'; + import { Codicon } from '../../../../../base/common/codicons.js'; + import { Event, ValueWithChangeEvent } from '../../../../../base/common/event.js'; + import { DisposableStore, toDisposable } from '../../../../../base/common/lifecycle.js'; +@@ -340,7 +340,7 @@ function renderDockedDetailPanel(editorPart: HTMLElement): void { + row.style.display = 'flex'; + row.style.justifyContent = 'space-between'; + row.style.padding = '6px 0'; +- row.appendChild(document.createTextNode(name)); ++ row.appendChild(createTextNode(name)); + const count = row.appendChild($('span')); + count.textContent = stats; + count.style.color = 'var(--vscode-descriptionForeground)'; +diff --git a/src/vs/sessions/contrib/chat/browser/noAgentHostEmptyState.ts b/src/vs/sessions/contrib/chat/browser/noAgentHostEmptyState.ts +index 74efba6ce27..619fa75d80d 100644 +--- a/src/vs/sessions/contrib/chat/browser/noAgentHostEmptyState.ts ++++ b/src/vs/sessions/contrib/chat/browser/noAgentHostEmptyState.ts +@@ -75,7 +75,7 @@ export class NoAgentHostEmptyState extends Disposable { + { renderCodeSegments: true }, + description + ); +- description.appendChild(document.createTextNode(' ')); ++ description.appendChild(dom.createTextNode(' ')); + const learnMore = dom.append(description, $('a.no-agent-host-link')) as HTMLAnchorElement; + learnMore.textContent = localize('noAgentHost.learnMore', "Learn more"); + learnMore.href = LEARN_MORE_URL; +diff --git a/src/vs/sessions/contrib/github/browser/githubReferenceList.ts b/src/vs/sessions/contrib/github/browser/githubReferenceList.ts +index d44e55dfae9..2d8fa228c80 100644 +--- a/src/vs/sessions/contrib/github/browser/githubReferenceList.ts ++++ b/src/vs/sessions/contrib/github/browser/githubReferenceList.ts +@@ -5,7 +5,7 @@ + + import './media/githubReferenceList.css'; + +-import { $, append } from '../../../../base/browser/dom.js'; ++import { $, append, createElement } from '../../../../base/browser/dom.js'; + import { ActionBar } from '../../../../base/browser/ui/actionbar/actionbar.js'; + import { IAction, toAction } from '../../../../base/common/actions.js'; + import { Disposable } from '../../../../base/common/lifecycle.js'; +@@ -64,7 +64,7 @@ export class GitHubReferenceList extends Di + + private _createRow(entry: T): IGitHubReferenceListRow { + const item = append(this.element, $('.sessions-github-reference-list-item', { role: 'listitem' })); +- const button = append(item, document.createElement('button')); ++ const button = append(item, createElement('button')); + button.className = 'sessions-github-reference-list-entry'; + button.type = 'button'; + const row: IGitHubReferenceListRow = { +diff --git a/src/vs/sessions/contrib/github/browser/issueHover.ts b/src/vs/sessions/contrib/github/browser/issueHover.ts +index cd572fceae2..df695edba1e 100644 +--- a/src/vs/sessions/contrib/github/browser/issueHover.ts ++++ b/src/vs/sessions/contrib/github/browser/issueHover.ts +@@ -5,7 +5,7 @@ + + import './media/issueHover.css'; + +-import { $, append } from '../../../../base/browser/dom.js'; ++import { $, append, createElement } from '../../../../base/browser/dom.js'; + import { safeIntl } from '../../../../base/common/date.js'; + import { localize } from '../../../../nls.js'; + import { IGitHubIssue } from '../common/types.js'; +@@ -25,7 +25,7 @@ export function createIssueHoverElement(data: IIssueHoverData): HTMLElement { + const hoverElement = $('.sessions-issue-hover'); + + const header = append(hoverElement, $('.sessions-issue-hover-header')); +- const repositoryLink = document.createElement('a'); ++ const repositoryLink = createElement('a'); + repositoryLink.className = 'sessions-issue-hover-repository'; + append(header, repositoryLink); + repositoryLink.href = data.repositoryHref; +diff --git a/src/vs/sessions/contrib/github/browser/pullRequestHover.ts b/src/vs/sessions/contrib/github/browser/pullRequestHover.ts +index 2b74d06a62d..594fb052be7 100644 +--- a/src/vs/sessions/contrib/github/browser/pullRequestHover.ts ++++ b/src/vs/sessions/contrib/github/browser/pullRequestHover.ts +@@ -5,7 +5,7 @@ + + import './media/pullRequestHover.css'; + +-import { $, append } from '../../../../base/browser/dom.js'; ++import { $, append, createElement } from '../../../../base/browser/dom.js'; + import { safeIntl } from '../../../../base/common/date.js'; + import { localize } from '../../../../nls.js'; + import { IGitHubPullRequest } from '../common/types.js'; +@@ -25,7 +25,7 @@ export function createPullRequestHoverElement(data: IPullRequestHoverData): HTML + const hoverElement = $('.sessions-pr-hover'); + + const header = append(hoverElement, $('.sessions-pr-hover-header')); +- const repositoryLink = document.createElement('a'); ++ const repositoryLink = createElement('a'); + repositoryLink.className = 'sessions-pr-hover-repository'; + append(header, repositoryLink); + repositoryLink.href = data.repositoryHref; diff --git a/src/vs/sessions/contrib/policyBlocked/browser/sessionsPolicyBlocked.ts b/src/vs/sessions/contrib/policyBlocked/browser/sessionsPolicyBlocked.ts -index baab4566729..3b58486908e 100644 +index baab4566729..10af7de714b 100644 --- a/src/vs/sessions/contrib/policyBlocked/browser/sessionsPolicyBlocked.ts +++ b/src/vs/sessions/contrib/policyBlocked/browser/sessionsPolicyBlocked.ts @@ -5,7 +5,7 @@ @@ -3592,6 +3853,31 @@ index baab4566729..3b58486908e 100644 const learnMore = append(description, $('a.sessions-policy-blocked-link')) as HTMLAnchorElement; learnMore.textContent = localize('policyBlocked.learnMore', "Learn more"); learnMore.href = 'https://aka.ms/VSCode/Agents/docs'; +@@ -132,11 +132,11 @@ export class SessionsPolicyBlockedOverlay extends Disposable { + + const description = append(card, $('p')); + if (options.accountName) { +- append(description, document.createTextNode( ++ append(description, createTextNode( + localize('accountGate.descriptionWithAccount', "The account \"{0}\" is not a member of an organization that your administrator allows for Agents.", options.accountName) + )); + } else { +- append(description, document.createTextNode( ++ append(description, createTextNode( + localize('accountGate.descriptionNoAccount', "Your administrator restricts Agents to members of the organizations below.") + )); + } +@@ -155,8 +155,8 @@ export class SessionsPolicyBlockedOverlay extends Disposable { + } + + const footer = append(card, $('p.sessions-policy-blocked-footer')); +- append(footer, document.createTextNode(localize('accountGate.contactAdmin', "Contact your administrator for more information."))); +- append(footer, document.createTextNode(' ')); ++ append(footer, createTextNode(localize('accountGate.contactAdmin', "Contact your administrator for more information."))); ++ append(footer, createTextNode(' ')); + const learnMore = append(footer, $('a.sessions-policy-blocked-link')) as HTMLAnchorElement; + learnMore.textContent = localize('accountGate.learnMore', "Learn more"); + learnMore.href = 'https://code.visualstudio.com/docs/enterprise/overview'; diff --git a/src/vs/workbench/api/browser/mainThreadCodeInsets.ts b/src/vs/workbench/api/browser/mainThreadCodeInsets.ts index ee7e9d98df6..5e622722dc5 100644 --- a/src/vs/workbench/api/browser/mainThreadCodeInsets.ts diff --git a/vscode-patches/0102-refactor-move-interface-in-common.patch b/vscode-patches/0102-refactor-move-interface-in-common.patch index 7147bfff..b1c69ac6 100644 --- a/vscode-patches/0102-refactor-move-interface-in-common.patch +++ b/vscode-patches/0102-refactor-move-interface-in-common.patch @@ -5,10 +5,10 @@ Subject: [PATCH] refactor: move interface in common instead of making platform import from sessions --- - .../agentHost/common/agentHostMcpServer.ts | 35 ++++++++++++++++++ - .../common/agentHostSessionsProvider.ts | 36 +++---------------- + .../agentHost/common/agentHostMcpServer.ts | 35 +++++++++++++++++ + .../common/agentHostSessionsProvider.ts | 39 ++++--------------- .../agentHostCustomizationService.ts | 2 +- - 3 files changed, 41 insertions(+), 32 deletions(-) + 3 files changed, 44 insertions(+), 32 deletions(-) create mode 100644 src/vs/platform/agentHost/common/agentHostMcpServer.ts diff --git a/src/vs/platform/agentHost/common/agentHostMcpServer.ts b/src/vs/platform/agentHost/common/agentHostMcpServer.ts @@ -53,10 +53,10 @@ index 00000000000..fc744605000 +} + diff --git a/src/vs/sessions/common/agentHostSessionsProvider.ts b/src/vs/sessions/common/agentHostSessionsProvider.ts -index dc9bb9d2da3..90388e74270 100644 +index dc9bb9d2da3..0e5fff47156 100644 --- a/src/vs/sessions/common/agentHostSessionsProvider.ts +++ b/src/vs/sessions/common/agentHostSessionsProvider.ts -@@ -4,18 +4,18 @@ +@@ -4,18 +4,21 @@ *--------------------------------------------------------------------------------------------*/ import { Event } from '../../base/common/event.js'; @@ -77,10 +77,13 @@ index dc9bb9d2da3..90388e74270 100644 import { ISessionAgentRef } from '../services/sessions/common/session.js'; -import type { AgentMergeSessionOverrides, AgentMergeSessionState } from '../../platform/agentHost/common/agentMerge.js'; +import { ISessionsProvider } from '../services/sessions/common/sessionsProvider.js'; ++export { ++ IAgentHostMcpServer ++}; /** * Progress emitted while an agent-host provider is establishing a connection. -@@ -85,32 +85,6 @@ export interface IAgentHostGroup { +@@ -85,32 +88,6 @@ export interface IAgentHostGroup { readonly connectable?: boolean; } From 70efdeae88439315219de454517dcafa06e6c9a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:21:25 +0200 Subject: [PATCH 02/35] feat: add session missing service overrides declaration --- src/missing-services.ts | 971 ++++++++++++++++++++++++++++++++++++++-- 1 file changed, 936 insertions(+), 35 deletions(-) diff --git a/src/missing-services.ts b/src/missing-services.ts index 5fedfaef..af663424 100644 --- a/src/missing-services.ts +++ b/src/missing-services.ts @@ -382,6 +382,8 @@ import type { import { IOutputService } from 'vs/workbench/services/output/common/output.service' import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite.service' import { IPathService } from 'vs/workbench/services/path/common/pathService.service' +import { AccountPolicyGateState } from 'vs/workbench/services/policies/common/accountPolicyService' +import { IAccountPolicyGateService } from 'vs/workbench/services/policies/common/accountPolicyService.service' import { IPreferencesService } from 'vs/workbench/services/preferences/common/preferences.service' import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService.service' import { PortsEnablement } from 'vs/workbench/services/remote/common/remoteExplorerService' @@ -421,8 +423,6 @@ import { IWorkingCopyHistoryService } from 'vs/workbench/services/workingCopy/co import { IWorkingCopyService } from 'vs/workbench/services/workingCopy/common/workingCopyService.service' import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing.service' import { IWorkspaceIdentityService } from 'vs/workbench/services/workspaces/common/workspaceIdentityService.service' -import { AccountPolicyGateState } from 'vs/workbench/services/policies/common/accountPolicyService' -import { IAccountPolicyGateService } from 'vs/workbench/services/policies/common/accountPolicyService.service' import { IAiSettingsSearchService } from 'vscode/src/vs/workbench/services/aiSettingsSearch/common/aiSettingsSearch.service' import { Codicon } from 'vs/base/common/codicons' @@ -449,31 +449,31 @@ import { IMeteredConnectionService } from 'vs/platform/meteredConnection/common/ import { IRemoteTunnelService } from 'vs/platform/remoteTunnel/common/remoteTunnel.service' import { IDiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService.service' import { IVoiceModeOnboardingService } from 'vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.service' -import type { IAgentSessionsModel } from 'vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel' -import { IAgentSessionsService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service' import { IAgentHostImportConversationStore } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostImportConversationStore.service' import { IAgentHostProtectedResourcesService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.service' import { IAgentHostSessionWorkingDirectorySynchronizer } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.service' import { IAgentHostShellInitSynchronizer } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.service' +import type { IAgentSessionsModel } from 'vs/workbench/contrib/chat/browser/agentSessions/agentSessionsModel' +import { IAgentSessionsService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service' import { IAgentSessionProjectionService } from 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.service' import { AgentStatusMode } from 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusService.js' import { IAgentTitleBarStatusService } from 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusService.service' import { ISessionSummaryHoverService } from 'vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.service' import { IChatPasteTargetService } from 'vs/workbench/contrib/chat/browser/chat.service' import { IChatEditingExplanationModelManager } from 'vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.service' -import { IChatModelFeedbackSurveyService } from 'vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyService.service' import { IChatPetService } from 'vs/workbench/contrib/chat/browser/chatPetService.service' import { IChatStatusItemService } from 'vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService.service' import { IChatSubmitRequestHandlerService } from 'vs/workbench/contrib/chat/browser/chatSubmitRequestHandlerService.service' +import { IChatTipService } from 'vs/workbench/contrib/chat/browser/chatTipService.service.js' +import { IChatContextService } from 'vs/workbench/contrib/chat/browser/contextContrib/chatContextService.service' +import { IChatModelFeedbackSurveyService } from 'vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyService.service' import { ChatSpeechToTextState } from 'vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService' import { IChatSpeechToTextService } from 'vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService.service' import { IDictationOnboardingService } from 'vs/workbench/contrib/chat/browser/speechToText/dictationOnboarding.service' import { IVoiceCodeTranscriptionClient } from 'vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.service' -import { IChatTipService } from 'vs/workbench/contrib/chat/browser/chatTipService.service.js' -import { IChatContextService } from 'vs/workbench/contrib/chat/browser/contextContrib/chatContextService.service' import { IVoiceInputModeService } from 'vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.service' -import { ICodeCompareModelService } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.service' import { IChatOutputPartStateCache } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatOutputPartStateCache.service' +import { ICodeCompareModelService } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.service' import { IChatPetWidgetService } from 'vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.service' import { IChatInputNoticeHubService } from 'vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.service' import { IAICustomizationWorkspaceService } from 'vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service' @@ -484,8 +484,8 @@ import { ILanguageModelsConfigurationService } from 'vs/workbench/contrib/chat/c import { IAgentPluginRepositoryService } from 'vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service.js' import { IAgentPluginService } from 'vs/workbench/contrib/chat/common/plugins/agentPluginService.service.js' import { IPluginMarketplaceService } from 'vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service.js' -import { ICustomizationMigrationService } from 'vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.service' import { Target } from 'vs/workbench/contrib/chat/common/promptSyntax/promptTypes.js' +import { ICustomizationMigrationService } from 'vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.service' import { ISessionChatPillVisibilityService } from 'vs/workbench/contrib/chat/common/sessionChatPills.service' import { ILanguageModelToolsConfirmationService } from 'vs/workbench/contrib/chat/common/tools/languageModelToolsConfirmationService.service' import { @@ -501,9 +501,9 @@ import { LazyCollectionState } from 'vs/workbench/contrib/mcp/common/mcpTypes' import { INotebookOutlineEntryFactory } from 'vs/workbench/contrib/notebook/browser/viewModel/notebookOutlineEntryFactory.service' import { ISCMRepositorySelectionMode } from 'vs/workbench/contrib/scm/common/scm' import { ITerminalChatSessionResolver } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChatSessionResolver.service' -import { ChatEntitlement } from 'vs/workbench/services/chat/common/chatEntitlementService' import { IAgentSdkSetupService } from 'vs/workbench/services/agentHost/browser/agentSdkSetupService.service' import { ICodexAccountService } from 'vs/workbench/services/agentHost/browser/codexAccountService.service' +import { ChatEntitlement } from 'vs/workbench/services/chat/common/chatEntitlementService' import { IInlineCompletionsUnificationService } from 'vs/workbench/services/inlineCompletions/common/inlineCompletionsUnification.service' import { IUserAttentionService } from 'vs/workbench/services/userAttention/common/userAttentionService.service' import { IWorkspaceFolderLabelService } from 'vs/workbench/services/workspaces/common/workspaceFolderLabelService.service' @@ -515,33 +515,97 @@ import { Unsupported, unsupported } from './tools.js' import { NullAgentHostService } from 'vs/platform/agentHost/browser/nullAgentHostService' import { NullSSHRemoteAgentHostService } from 'vs/platform/agentHost/browser/nullSshRemoteAgentHostService' +import { IAgentHostByokLmHandler } from 'vs/platform/agentHost/common/agentHostByokLm.service' import { IAgentHostConnectionsService } from 'vs/platform/agentHost/common/agentHostConnectionsService.service' import { IAgentHostEnablementService } from 'vs/platform/agentHost/common/agentHostEnablementService.service' import { IAgentHostResourceService } from 'vs/platform/agentHost/common/agentHostResourceService.service' import { IAgentHostService } from 'vs/platform/agentHost/common/agentService.service' +import { + ICloudSandboxAgentHostService, + ICloudSandboxApiService +} from 'vs/platform/agentHost/common/cloudSandboxAgentHost.service' +import { IRemoteAgentHostLocationPreferenceService } from 'vs/platform/agentHost/common/remoteAgentHostLocationPreference.service' import { NullRemoteAgentHostService } from 'vs/platform/agentHost/common/remoteAgentHostService.js' import { IRemoteAgentHostService } from 'vs/platform/agentHost/common/remoteAgentHostService.service' import { ISSHRemoteAgentHostService } from 'vs/platform/agentHost/common/sshRemoteAgentHost.service' +import { ITunnelAgentHostService } from 'vs/platform/agentHost/common/tunnelAgentHost.service' +import { IGitHubService } from 'vs/platform/github/common/githubService.service.js' import { IAgentNetworkFilterService } from 'vs/platform/networkFilter/common/networkFilterService.service.js' import { ISandboxHelperService } from 'vs/platform/sandbox/common/sandboxHelperService.service.js' +import { IWindowsMxcTerminalSandboxRuntime } from 'vs/platform/sandbox/common/terminalSandboxMxcRuntime.service.js' import { ITerminalSandboxService } from 'vs/platform/sandbox/common/terminalSandboxService.service.js' +import { IChatDashboardService } from 'vs/sessions/browser/chatDashboardService.service' +import { IMobileVisualViewport } from 'vs/sessions/browser/parts/mobile/mobileVisualViewport.service' +import { ISessionsSetUpService } from 'vs/sessions/browser/sessionsSetUpService.service' +import { IDevContainerAgentHostService } from 'vs/sessions/common/devContainerAgentHostService.service' +import { IAgentFeedbackService } from 'vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.service' +import { IAquariumService } from 'vs/sessions/contrib/aquarium/browser/aquariumOverlay.service' +import { IAutomationStorageService } from 'vs/sessions/contrib/automations/common/automationStorageService.service' +import { ChangesViewMode } from 'vs/sessions/contrib/changes/common/changes.js' +import { IChangesViewService } from 'vs/sessions/contrib/changes/common/changesViewService.service' +import { ISessionChangesService } from 'vs/sessions/contrib/changes/common/sessionChangesService.service' +import { ISessionsChatViewStateService } from 'vs/sessions/contrib/chat/browser/chatViewStateService.service' +import { INewChatVoiceTargetService } from 'vs/sessions/contrib/chat/browser/newChatVoice.service' +import { INewSessionComposerService } from 'vs/sessions/contrib/chat/browser/newSessionComposerService.service' +import { ISessionArchiveNudgeService } from 'vs/sessions/contrib/chat/browser/sessionArchiveNudge.service' +import { ISessionChatPillsDebugService } from 'vs/sessions/contrib/chat/browser/sessionChatInputToolbarDebug.service' +import { ISessionTaskRunnerRegistry } from 'vs/sessions/contrib/chat/browser/sessionTaskRunner.service' +import { ISessionsTasksService } from 'vs/sessions/contrib/chat/browser/sessionsTasksService.service' +import { ICodeReviewService } from 'vs/sessions/contrib/codeReview/browser/codeReviewService.service' +import { IDiffEditorOptionsService } from 'vs/sessions/contrib/editor/common/diffEditorOptionsService.service' +import { IGitHubService as IGitHubSessionService } from 'vs/sessions/contrib/github/browser/githubService.service' +import { IPullRequestIconCache } from 'vs/sessions/contrib/github/browser/pullRequestIconCache.service' +import { ICloudSandboxTelemetryService } from 'vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxTelemetry.service' +import { IRemoteAgentHostConnectionCustomizationService } from 'vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostConnectionCustomization.service' +import { IAgentHostFilterService } from 'vs/sessions/services/agentHostFilter/common/agentHostFilter.service' +import { ISessionsChatBackgroundService } from 'vs/sessions/services/chatBackground/browser/chatBackgroundService.service' +import { IChatViewFactory } from 'vs/sessions/services/chatView/browser/chatViewFactory.service' +import { ICustomViewGridPartService } from 'vs/sessions/services/customView/browser/customViewGridPartService.service' +import { ICustomViewService } from 'vs/sessions/services/customView/browser/customViewService.service' +import { ISessionContext } from 'vs/sessions/services/sessions/browser/sessionContext.service' +import { ISessionGroupsService } from 'vs/sessions/services/sessions/browser/sessionGroupsService.service' +import { ISessionOpenTelemetryService } from 'vs/sessions/services/sessions/browser/sessionOpenTelemetryService.service' +import { ISessionSectionOrderService } from 'vs/sessions/services/sessions/browser/sessionSectionOrderService.service' +import { ISessionsListModelService } from 'vs/sessions/services/sessions/browser/sessionsListModelService.service' +import { ISessionsPartService } from 'vs/sessions/services/sessions/browser/sessionsPartService.service' +import { ISessionsProvidersService } from 'vs/sessions/services/sessions/browser/sessionsProvidersService.service' +import { ISessionsRecentWorkspacesService } from 'vs/sessions/services/sessions/browser/sessionsRecentWorkspacesService.service' +import { ISessionsService } from 'vs/sessions/services/sessions/browser/sessionsService.service' +import { ISessionsWindowUsageService } from 'vs/sessions/services/sessions/browser/sessionsWindowUsageService.service' +import { ISessionChangesStatsCache } from 'vs/sessions/services/sessions/common/sessionChangesStatsCache.service' +import { ISessionsManagementService } from 'vs/sessions/services/sessions/common/sessionsManagement.service' +import { IAgentsVoiceWindowService } from 'vs/workbench/contrib/agentsVoice/common/agentsVoice.service' +import { IVoiceTranscriptStore } from 'vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.service' +import { BrowserEditorInput } from 'vs/workbench/contrib/browserView/common/browserEditorInput' import { IBrowserViewCDPService, IBrowserViewWorkbenchService } from 'vs/workbench/contrib/browserView/common/browserView.service.js' import { IBrowserZoomService } from 'vs/workbench/contrib/browserView/common/browserZoomService.service.js' -import { IAgentHostSessionWorkingDirectoryResolver } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.service' +import { IAgentHostDebugLogsExportService } from 'vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.service' +import { IAgentHostActiveClientService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service' +import { IAgentHostCustomizationService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.service' import { IAgentHostNewSessionFolderService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.service' +import { IAgentHostSessionWorkingDirectoryResolver } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.service' import { IAgentHostToolSetEnablementService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.service' +import { IAgentHostUntitledProvisionalSessionService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.service' import type { IAICustomizationItemSource } from 'vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemSource' import { IAICustomizationItemsModel } from 'vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.service' import { IChatAttachmentWidgetRegistry } from 'vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry.service' +import { IChatGoalSummaryService } from 'vs/workbench/contrib/chat/browser/chatGoalSummaryService.service' +import { IChatImageCarouselService } from 'vs/workbench/contrib/chat/browser/chatImageCarouselService.service.js' import { IChatResponseFileChangesService } from 'vs/workbench/contrib/chat/browser/chatResponseFileChangesService.service' import { IPlanReviewFeedbackService } from 'vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.service' import { IChatToolRiskAssessmentService } from 'vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.service' +import { IMicCaptureService } from 'vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.service' +import { ITtsPlaybackService } from 'vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.service' +import { IVoiceSessionController } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.service' +import { IVoiceToolDispatchService } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.service' import { IChatInputNotificationService } from 'vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.service' import { IChatPhoneInputPresenter } from 'vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.service' -import { IChatImageCarouselService } from 'vs/workbench/contrib/chat/browser/chatImageCarouselService.service.js' +import { IAutomationDialogService } from 'vs/workbench/contrib/chat/common/automations/automationDialogService.service' +import { IAutomationRunner } from 'vs/workbench/contrib/chat/common/automations/automationRunner.service' +import { IAutomationService } from 'vs/workbench/contrib/chat/common/automations/automationService.service' import { IChatDebugService } from 'vs/workbench/contrib/chat/common/chatDebugService.service.js' import type { IHarnessDescriptor } from 'vs/workbench/contrib/chat/common/customizationHarnessService' import { ICustomizationHarnessService } from 'vs/workbench/contrib/chat/common/customizationHarnessService.service' @@ -551,37 +615,25 @@ import { IPluginInstallService } from 'vs/workbench/contrib/chat/common/plugins/ import { IWorkspacePluginSettingsService } from 'vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.service.js' import { IChatArtifactsService } from 'vs/workbench/contrib/chat/common/tools/chatArtifactsService.service.js' import { IToolResultCompressor } from 'vs/workbench/contrib/chat/common/tools/toolResultCompressor.service' +import { IVoiceClientService } from 'vs/workbench/contrib/chat/common/voiceClient/voiceClientService.service' +import { IVoicePlaybackService } from 'vs/workbench/contrib/chat/common/voicePlaybackService.service' import { IChatResponseResourceFileSystemProvider } from 'vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.service.js' import { IGitService } from 'vs/workbench/contrib/git/common/gitService.service.js' -import { BrowserEditorInput } from 'vs/workbench/contrib/browserView/common/browserEditorInput' +import { IGitHubUploadService } from 'vs/workbench/contrib/issue/browser/githubUploadService.service' +import { RecordingState } from 'vs/workbench/contrib/issue/browser/recordingService' +import { IRecordingService } from 'vs/workbench/contrib/issue/browser/recordingService.service' +import { IScreenshotService } from 'vs/workbench/contrib/issue/browser/screenshotService.service' +import { IMcpDevModeDebugging } from 'vs/workbench/contrib/mcp/common/mcpDevMode.service.js' import { IWorkbenchMcpGatewayService } from 'vs/workbench/contrib/mcp/common/mcpGatewayService.service.js' import { IMcpSandboxService } from 'vs/workbench/contrib/mcp/common/mcpSandboxService.service.js' +import { IOnboardingScenarioService } from 'vs/workbench/contrib/onboarding/common/onboardingScenarioService.service' +import { ISplashStorageService } from 'vs/workbench/contrib/splash/browser/splash.service' import { IAgentHostTerminalService } from 'vs/workbench/contrib/terminal/browser/agentHostTerminalService.service.js' -import { IMicCaptureService } from 'vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.service' -import { ITtsPlaybackService } from 'vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.service' -import { IVoiceSessionController } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.service' -import { IVoiceToolDispatchService } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.service' -import { IVoiceClientService } from 'vs/workbench/contrib/chat/common/voiceClient/voiceClientService.service' -import { IVoicePlaybackService } from 'vs/workbench/contrib/chat/common/voicePlaybackService.service' -import { IAgentsVoiceWindowService } from 'vs/workbench/contrib/agentsVoice/common/agentsVoice.service' -import { IVoiceTranscriptStore } from 'vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.service' import { IOnboardingService } from 'vs/workbench/contrib/welcomeOnboarding/common/onboardingService.service.js' -import { IOnboardingScenarioService } from 'vs/workbench/contrib/onboarding/common/onboardingScenarioService.service' -import { IAgentHostFileSystemService } from 'vs/workbench/services/agentHost/common/agentHostFileSystemService.service' import { IAgentEditorCommentsBridge } from 'vs/workbench/services/agentEditorComments/common/agentEditorComments.service' +import { IAgentHostFileSystemService } from 'vs/workbench/services/agentHost/common/agentHostFileSystemService.service' import { IPowerService } from 'vs/workbench/services/power/common/powerService.service.js' import { FileSystemProviderCapabilities } from './service-override/files.js' -import { IAgentHostDebugLogsExportService } from 'vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.service' -import { IAgentHostUntitledProvisionalSessionService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.service' -import { IWindowsMxcTerminalSandboxRuntime } from 'vs/platform/sandbox/common/terminalSandboxMxcRuntime.service.js' -import { IScreenshotService } from 'vs/workbench/contrib/issue/browser/screenshotService.service' -import { IRecordingService } from 'vs/workbench/contrib/issue/browser/recordingService.service' -import { RecordingState } from 'vs/workbench/contrib/issue/browser/recordingService' -import { IGitHubUploadService } from 'vs/workbench/contrib/issue/browser/githubUploadService.service' -import { IChatGoalSummaryService } from 'vs/workbench/contrib/chat/browser/chatGoalSummaryService.service' -import { IAgentHostCustomizationService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.service' -import { IAgentHostActiveClientService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service' -import { IGitHubService } from 'vs/platform/github/common/githubService.service.js' /** * Editor services: all editor service that are not defined in vs/editor/standalone/ @@ -8411,7 +8463,6 @@ registerSingleton( WorkspaceFolderLabelService, InstantiationType.Delayed ) - class GitHubService implements IGitHubService { _serviceBrand: undefined @Unsupported @@ -8445,3 +8496,853 @@ class GitHubService implements IGitHubService { } registerSingleton(IGitHubService, GitHubService, InstantiationType.Delayed) + +class RemoteAgentHostLocationPreferenceService implements IRemoteAgentHostLocationPreferenceService { + _serviceBrand: undefined + onDidChangePreference: IRemoteAgentHostLocationPreferenceService['onDidChangePreference'] = + Event.None + getPreference: IRemoteAgentHostLocationPreferenceService['getPreference'] = () => undefined + setPreference: IRemoteAgentHostLocationPreferenceService['setPreference'] = () => {} +} + +registerSingleton( + IRemoteAgentHostLocationPreferenceService, + RemoteAgentHostLocationPreferenceService, + InstantiationType.Delayed +) + +class SessionsSetUpService implements ISessionsSetUpService { + _serviceBrand: undefined + initialSignInDialogShown: ISessionsSetUpService['initialSignInDialogShown'] = false + whenWelcomeDone: ISessionsSetUpService['whenWelcomeDone'] = async () => {} +} + +registerSingleton(ISessionsSetUpService, SessionsSetUpService, InstantiationType.Delayed) + +class ChatDashboardService implements IChatDashboardService { + _serviceBrand: undefined + createDashboardElement: IChatDashboardService['createDashboardElement'] = () => undefined +} + +registerSingleton(IChatDashboardService, ChatDashboardService, InstantiationType.Delayed) + +class CustomViewGridPartService implements ICustomViewGridPartService { + _serviceBrand: undefined + setView: ICustomViewGridPartService['setView'] = () => {} + focusActiveView: ICustomViewGridPartService['focusActiveView'] = () => {} +} + +registerSingleton(ICustomViewGridPartService, CustomViewGridPartService, InstantiationType.Delayed) + +class SessionsPartService implements ISessionsPartService { + _serviceBrand: undefined + updateVisibleSessions: ISessionsPartService['updateVisibleSessions'] = () => {} + setContentVisible: ISessionsPartService['setContentVisible'] = () => {} + onDidFocusSession: ISessionsPartService['onDidFocusSession'] = Event.None + toggleMaximizeSession: ISessionsPartService['toggleMaximizeSession'] = () => {} + onDidToggleMaximizeSession: ISessionsPartService['onDidToggleMaximizeSession'] = Event.None + focusSession: ISessionsPartService['focusSession'] = () => {} + getSessionView: ISessionsPartService['getSessionView'] = () => undefined + getFocusedSessionView: ISessionsPartService['getFocusedSessionView'] = () => undefined + @Unsupported + getProgressIndicator: ISessionsPartService['getProgressIndicator'] = unsupported +} + +registerSingleton(ISessionsPartService, SessionsPartService, InstantiationType.Delayed) + +class MobileVisualViewport implements IMobileVisualViewport { + _serviceBrand: undefined + keyboardHeight: IMobileVisualViewport['keyboardHeight'] = constObservable(0) + isKeyboardVisible: IMobileVisualViewport['isKeyboardVisible'] = constObservable(false) +} + +registerSingleton(IMobileVisualViewport, MobileVisualViewport, InstantiationType.Delayed) + +class AgentFeedbackService implements IAgentFeedbackService { + _serviceBrand: undefined + onDidChangeFeedback: IAgentFeedbackService['onDidChangeFeedback'] = Event.None + onDidChangeFeedbackVisibility: IAgentFeedbackService['onDidChangeFeedbackVisibility'] = Event.None + onDidChangeNavigation: IAgentFeedbackService['onDidChangeNavigation'] = Event.None + onDidRevealSessionComment: IAgentFeedbackService['onDidRevealSessionComment'] = Event.None + onDidChangeFeedbackScope: IAgentFeedbackService['onDidChangeFeedbackScope'] = Event.None + @Unsupported + get activeFeedbackSessionResource(): IAgentFeedbackService['activeFeedbackSessionResource'] { + return unsupported() + } + onDidAddFeedback: IAgentFeedbackService['onDidAddFeedback'] = Event.None + onDidConvertFeedback: IAgentFeedbackService['onDidConvertFeedback'] = Event.None + onDidAddReply: IAgentFeedbackService['onDidAddReply'] = Event.None + onDidSubmitFeedback: IAgentFeedbackService['onDidSubmitFeedback'] = Event.None + @Unsupported + addFeedback: IAgentFeedbackService['addFeedback'] = unsupported + acceptFeedback: IAgentFeedbackService['acceptFeedback'] = () => {} + removeFeedback: IAgentFeedbackService['removeFeedback'] = () => {} + updateFeedback: IAgentFeedbackService['updateFeedback'] = () => {} + updateFeedbackSourcePullRequest: IAgentFeedbackService['updateFeedbackSourcePullRequest'] = + () => {} + setFeedbackResolved: IAgentFeedbackService['setFeedbackResolved'] = () => {} + addReply: IAgentFeedbackService['addReply'] = () => {} + getFeedback: IAgentFeedbackService['getFeedback'] = () => [] + showFeedbackInEditor: IAgentFeedbackService['showFeedbackInEditor'] = () => {} + hideFeedbackInEditor: IAgentFeedbackService['hideFeedbackInEditor'] = () => {} + getVisibleResolvedFeedbackIds: IAgentFeedbackService['getVisibleResolvedFeedbackIds'] = () => + new Set() + hasLoadedFeedback: IAgentFeedbackService['hasLoadedFeedback'] = () => false + getSessionForFile: IAgentFeedbackService['getSessionForFile'] = () => undefined + getFeedbackSessionResource: IAgentFeedbackService['getFeedbackSessionResource'] = () => undefined + registerFeedbackResourceScope: IAgentFeedbackService['registerFeedbackResourceScope'] = () => + Disposable.None + getMostRecentSessionForResource: IAgentFeedbackService['getMostRecentSessionForResource'] = () => + undefined + revealFeedback: IAgentFeedbackService['revealFeedback'] = async () => {} + revealSessionComment: IAgentFeedbackService['revealSessionComment'] = async () => {} + getNextFeedback: IAgentFeedbackService['getNextFeedback'] = () => undefined + getNextNavigableItem: IAgentFeedbackService['getNextNavigableItem'] = () => undefined + setNavigationAnchor: IAgentFeedbackService['setNavigationAnchor'] = () => {} + @Unsupported + getNavigationBearing: IAgentFeedbackService['getNavigationBearing'] = unsupported + clearFeedback: IAgentFeedbackService['clearFeedback'] = () => {} + markFeedbackSubmitted: IAgentFeedbackService['markFeedbackSubmitted'] = () => {} + submitFeedback: IAgentFeedbackService['submitFeedback'] = async () => false + addFeedbackAndSubmit: IAgentFeedbackService['addFeedbackAndSubmit'] = async () => {} +} + +registerSingleton(IAgentFeedbackService, AgentFeedbackService, InstantiationType.Delayed) + +class AquariumService implements IAquariumService { + _serviceBrand: undefined + actionVisible: IAquariumService['actionVisible'] = constObservable(false) + @Unsupported + mountToggle: IAquariumService['mountToggle'] = unsupported + toggleActionVisibility: IAquariumService['toggleActionVisibility'] = () => false + simulateStreak: IAquariumService['simulateStreak'] = () => {} +} + +registerSingleton(IAquariumService, AquariumService, InstantiationType.Delayed) + +class AutomationStorageService implements IAutomationStorageService { + _serviceBrand: undefined + read: IAutomationStorageService['read'] = async () => undefined + @Unsupported + compareAndSwap: IAutomationStorageService['compareAndSwap'] = unsupported +} + +registerSingleton(IAutomationStorageService, AutomationStorageService, InstantiationType.Delayed) + +class AutomationService implements IAutomationService { + _serviceBrand: undefined + canRunAutomation: IAutomationService['canRunAutomation'] = undefined + canUpdateAutomation: IAutomationService['canUpdateAutomation'] = undefined + canDeleteAutomation: IAutomationService['canDeleteAutomation'] = undefined + isSchedulingOwnedByHost: IAutomationService['isSchedulingOwnedByHost'] = undefined + startStaleRunRecovery: IAutomationService['startStaleRunRecovery'] = async () => {} + stopStaleRunRecovery: IAutomationService['stopStaleRunRecovery'] = () => {} + @Unsupported + get catalogueState(): IAutomationService['catalogueState'] { + return unsupported() + } + automations: IAutomationService['automations'] = constObservable([]) + runs: IAutomationService['runs'] = constObservable([]) + getAutomation: IAutomationService['getAutomation'] = () => undefined + runsFor: IAutomationService['runsFor'] = () => constObservable([]) + @Unsupported + createAutomation: IAutomationService['createAutomation'] = unsupported + @Unsupported + updateAutomation: IAutomationService['updateAutomation'] = unsupported + @Unsupported + updateAutomationIfUnchanged: IAutomationService['updateAutomationIfUnchanged'] = unsupported + deleteAutomation: IAutomationService['deleteAutomation'] = async () => {} + @Unsupported + recordRunStart: IAutomationService['recordRunStart'] = unsupported + updateRun: IAutomationService['updateRun'] = async () => undefined + deleteRun: IAutomationService['deleteRun'] = async () => {} + getActiveRunFor: IAutomationService['getActiveRunFor'] = () => undefined + markStaleRunsFailed: IAutomationService['markStaleRunsFailed'] = async () => {} +} + +registerSingleton(IAutomationService, AutomationService, InstantiationType.Delayed) + +class AutomationRunner implements IAutomationRunner { + _serviceBrand: undefined + @Unsupported + runOnce: IAutomationRunner['runOnce'] = unsupported +} + +registerSingleton(IAutomationRunner, AutomationRunner, InstantiationType.Delayed) + +class AutomationDialogService implements IAutomationDialogService { + _serviceBrand: undefined + showAutomationDialog: IAutomationDialogService['showAutomationDialog'] = async () => undefined +} + +registerSingleton(IAutomationDialogService, AutomationDialogService, InstantiationType.Delayed) + +class ChangesViewService implements IChangesViewService { + _serviceBrand: undefined + activeSessionResourceObs: IChangesViewService['activeSessionResourceObs'] = + constObservable(undefined) + activeSessionTypeObs: IChangesViewService['activeSessionTypeObs'] = constObservable(undefined) + activeSessionIsVirtualWorkspaceObs: IChangesViewService['activeSessionIsVirtualWorkspaceObs'] = + constObservable(false) + activeSessionChangesObs: IChangesViewService['activeSessionChangesObs'] = constObservable([]) + activeSessionChangesetsObs: IChangesViewService['activeSessionChangesetsObs'] = + constObservable(undefined) + activeSessionChangesetsLoadingObs: IChangesViewService['activeSessionChangesetsLoadingObs'] = + constObservable(false) + activeSessionChangesetObs: IChangesViewService['activeSessionChangesetObs'] = + constObservable(undefined) + activeSessionChangesetLoadingObs: IChangesViewService['activeSessionChangesetLoadingObs'] = + constObservable(false) + activeSessionChangesetOperationsObs: IChangesViewService['activeSessionChangesetOperationsObs'] = + constObservable([]) + activeSessionHasGitRepositoryObs: IChangesViewService['activeSessionHasGitRepositoryObs'] = + constObservable(false) + activeSessionReviewCommentCountByFileObs: IChangesViewService['activeSessionReviewCommentCountByFileObs'] = + constObservable(new Map()) + activeSessionAgentFeedbackCountByFileObs: IChangesViewService['activeSessionAgentFeedbackCountByFileObs'] = + constObservable(new Map()) + activeSessionStateObs: IChangesViewService['activeSessionStateObs'] = constObservable(undefined) + activeSessionLoadingObs: IChangesViewService['activeSessionLoadingObs'] = constObservable(false) + @Unsupported + get activeSessionSectionCollapseStateObs(): IChangesViewService['activeSessionSectionCollapseStateObs'] { + return unsupported() + } + setChangesetId: IChangesViewService['setChangesetId'] = () => {} + showChangeset: IChangesViewService['showChangeset'] = () => {} + viewModeObs = constObservable(ChangesViewMode.List) + setViewMode: IChangesViewService['setViewMode'] = () => {} + setSectionCollapsed: IChangesViewService['setSectionCollapsed'] = () => {} + detailsViewStateTransferObs: IChangesViewService['detailsViewStateTransferObs'] = + constObservable(undefined) + getDetailsViewState: IChangesViewService['getDetailsViewState'] = () => undefined + setDetailsViewState: IChangesViewService['setDetailsViewState'] = () => {} + setChangesetFilesReviewState: IChangesViewService['setChangesetFilesReviewState'] = () => {} +} + +registerSingleton(IChangesViewService, ChangesViewService, InstantiationType.Delayed) + +class SessionChangesService implements ISessionChangesService { + _serviceBrand: undefined + activeSessionUncommittedChangesCountObs: ISessionChangesService['activeSessionUncommittedChangesCountObs'] = + constObservable(undefined) + @Unsupported + getChangesEditorResource: ISessionChangesService['getChangesEditorResource'] = unsupported + getSessionResource: ISessionChangesService['getSessionResource'] = () => undefined + openChangesEditor: ISessionChangesService['openChangesEditor'] = async () => undefined +} + +registerSingleton(ISessionChangesService, SessionChangesService, InstantiationType.Delayed) + +class SessionTaskRunnerRegistry implements ISessionTaskRunnerRegistry { + _serviceBrand: undefined + register: ISessionTaskRunnerRegistry['register'] = () => Disposable.None + getRunner: ISessionTaskRunnerRegistry['getRunner'] = () => undefined +} + +registerSingleton(ISessionTaskRunnerRegistry, SessionTaskRunnerRegistry, InstantiationType.Delayed) + +class SessionsTasksService implements ISessionsTasksService { + _serviceBrand: undefined + onDidRunTask: ISessionsTasksService['onDidRunTask'] = Event.None + getSessionTasks: ISessionsTasksService['getSessionTasks'] = () => constObservable([]) + getSessionTasksOnce: ISessionsTasksService['getSessionTasksOnce'] = async () => [] + getAllTasks: ISessionsTasksService['getAllTasks'] = async () => [] + getNonSessionTasks: ISessionsTasksService['getNonSessionTasks'] = async () => [] + addTaskToSessions: ISessionsTasksService['addTaskToSessions'] = async () => {} + createAndAddTask: ISessionsTasksService['createAndAddTask'] = async () => undefined + updateTask: ISessionsTasksService['updateTask'] = async () => {} + removeTask: ISessionsTasksService['removeTask'] = async () => {} + runTask: ISessionsTasksService['runTask'] = async () => undefined + getPinnedTaskLabel: ISessionsTasksService['getPinnedTaskLabel'] = () => constObservable(undefined) + setPinnedTaskLabel: ISessionsTasksService['setPinnedTaskLabel'] = () => {} + getBrowserUrl: ISessionsTasksService['getBrowserUrl'] = () => constObservable(undefined) + setBrowserUrl: ISessionsTasksService['setBrowserUrl'] = () => {} + getPinnedBrowser: ISessionsTasksService['getPinnedBrowser'] = () => constObservable(false) + setPinnedBrowser: ISessionsTasksService['setPinnedBrowser'] = () => {} +} + +registerSingleton(ISessionsTasksService, SessionsTasksService, InstantiationType.Delayed) + +class ChatViewFactory implements IChatViewFactory { + _serviceBrand: undefined + @Unsupported + createNewChatView: IChatViewFactory['createNewChatView'] = unsupported + @Unsupported + createChatView: IChatViewFactory['createChatView'] = unsupported +} + +registerSingleton(IChatViewFactory, ChatViewFactory, InstantiationType.Delayed) + +class SessionsChatViewStateService implements ISessionsChatViewStateService { + _serviceBrand: undefined + get: ISessionsChatViewStateService['get'] = () => undefined + set: ISessionsChatViewStateService['set'] = () => {} +} + +registerSingleton( + ISessionsChatViewStateService, + SessionsChatViewStateService, + InstantiationType.Delayed +) + +class SessionsChatBackgroundService implements ISessionsChatBackgroundService { + _serviceBrand: undefined + onDidChangeBackground: ISessionsChatBackgroundService['onDidChangeBackground'] = Event.None + getBackground: ISessionsChatBackgroundService['getBackground'] = () => undefined + getConfiguredBackgroundImage: ISessionsChatBackgroundService['getConfiguredBackgroundImage'] = + () => undefined + getRecentBackgroundImages: ISessionsChatBackgroundService['getRecentBackgroundImages'] = () => [] + @Unsupported + getBackgroundImageLayout: ISessionsChatBackgroundService['getBackgroundImageLayout'] = unsupported + setBackground: ISessionsChatBackgroundService['setBackground'] = async () => {} + clearBackground: ISessionsChatBackgroundService['clearBackground'] = async () => {} + setBackgroundImageLayout: ISessionsChatBackgroundService['setBackgroundImageLayout'] = + async () => {} +} + +registerSingleton( + ISessionsChatBackgroundService, + SessionsChatBackgroundService, + InstantiationType.Delayed +) + +class SessionArchiveNudgeService implements ISessionArchiveNudgeService { + _serviceBrand: undefined + isDismissed: ISessionArchiveNudgeService['isDismissed'] = () => false + markShown: ISessionArchiveNudgeService['markShown'] = () => {} + dismiss: ISessionArchiveNudgeService['dismiss'] = () => {} + showArchiveOnboarding: ISessionArchiveNudgeService['showArchiveOnboarding'] = async () => {} + archive: ISessionArchiveNudgeService['archive'] = async () => {} +} + +registerSingleton( + ISessionArchiveNudgeService, + SessionArchiveNudgeService, + InstantiationType.Delayed +) + +class NewChatVoiceTargetService implements INewChatVoiceTargetService { + _serviceBrand: undefined + activeComposer: INewChatVoiceTargetService['activeComposer'] = constObservable(undefined) + currentVoiceInputResource: INewChatVoiceTargetService['currentVoiceInputResource'] = + constObservable(undefined) + registerComposer: INewChatVoiceTargetService['registerComposer'] = () => Disposable.None + setActive: INewChatVoiceTargetService['setActive'] = () => {} + beginVoiceTransition: INewChatVoiceTargetService['beginVoiceTransition'] = () => Disposable.None + consumeVoiceTransition: INewChatVoiceTargetService['consumeVoiceTransition'] = () => false +} + +registerSingleton(INewChatVoiceTargetService, NewChatVoiceTargetService, InstantiationType.Delayed) + +class NewSessionComposerService implements INewSessionComposerService { + _serviceBrand: undefined + activeComposer: INewSessionComposerService['activeComposer'] = constObservable(undefined) + workspaceSelection: INewSessionComposerService['workspaceSelection'] = constObservable(undefined) + userWorkspaceSelectionVersion: INewSessionComposerService['userWorkspaceSelectionVersion'] = + constObservable(0) + notifyUserWorkspaceSelection: INewSessionComposerService['notifyUserWorkspaceSelection'] = + () => {} + userNavigationVersion: INewSessionComposerService['userNavigationVersion'] = constObservable(0) + notifyUserNavigation: INewSessionComposerService['notifyUserNavigation'] = () => {} + onWillSendRequest: INewSessionComposerService['onWillSendRequest'] = Event.None + notifyWillSendRequest: INewSessionComposerService['notifyWillSendRequest'] = () => {} + registerComposer: INewSessionComposerService['registerComposer'] = () => Disposable.None +} + +registerSingleton(INewSessionComposerService, NewSessionComposerService, InstantiationType.Delayed) + +class SessionChatPillsDebugService implements ISessionChatPillsDebugService { + _serviceBrand: undefined + register: ISessionChatPillsDebugService['register'] = () => Disposable.None + clear: ISessionChatPillsDebugService['clear'] = () => {} + showDialog: ISessionChatPillsDebugService['showDialog'] = async () => {} +} + +registerSingleton( + ISessionChatPillsDebugService, + SessionChatPillsDebugService, + InstantiationType.Delayed +) + +class AgentHostByokLmHandler implements IAgentHostByokLmHandler { + _serviceBrand: undefined + onDidChangeModels: IAgentHostByokLmHandler['onDidChangeModels'] = undefined + @Unsupported + chat: IAgentHostByokLmHandler['chat'] = unsupported + listModels: IAgentHostByokLmHandler['listModels'] = async () => [] +} + +registerSingleton(IAgentHostByokLmHandler, AgentHostByokLmHandler, InstantiationType.Delayed) + +class CodeReviewService implements ICodeReviewService { + _serviceBrand: undefined + @Unsupported + getPRReviewState: ICodeReviewService['getPRReviewState'] = unsupported + resolvePRReviewThread: ICodeReviewService['resolvePRReviewThread'] = async () => {} + markPRReviewCommentConverted: ICodeReviewService['markPRReviewCommentConverted'] = () => {} + dismissPRReviewComment: ICodeReviewService['dismissPRReviewComment'] = () => {} +} + +registerSingleton(ICodeReviewService, CodeReviewService, InstantiationType.Delayed) + +class DiffEditorOptionsService implements IDiffEditorOptionsService { + _serviceBrand: undefined + @Unsupported + get viewMode(): IDiffEditorOptionsService['viewMode'] { + return unsupported() + } + renderSideBySide: IDiffEditorOptionsService['renderSideBySide'] = constObservable(false) + @Unsupported + get diffEditorWordWrap(): IDiffEditorOptionsService['diffEditorWordWrap'] { + return unsupported() + } + @Unsupported + get editorWordWrap(): IDiffEditorOptionsService['editorWordWrap'] { + return unsupported() + } + setViewMode: IDiffEditorOptionsService['setViewMode'] = () => {} + toggleRenderSideBySide: IDiffEditorOptionsService['toggleRenderSideBySide'] = () => {} + setDiffEditorWordWrap: IDiffEditorOptionsService['setDiffEditorWordWrap'] = async () => {} + setEditorWordWrap: IDiffEditorOptionsService['setEditorWordWrap'] = async () => {} +} + +registerSingleton(IDiffEditorOptionsService, DiffEditorOptionsService, InstantiationType.Delayed) + +class GitHubSessionService implements IGitHubSessionService { + _serviceBrand: undefined + enterpriseHost: IGitHubSessionService['enterpriseHost'] = undefined + activeSessionPullRequestObs: IGitHubSessionService['activeSessionPullRequestObs'] = + constObservable(undefined) + activeSessionPullRequestCIObs: IGitHubSessionService['activeSessionPullRequestCIObs'] = + constObservable(undefined) + activeSessionPullRequestReviewThreadsObs: IGitHubSessionService['activeSessionPullRequestReviewThreadsObs'] = + constObservable(undefined) + @Unsupported + createRepositoryModelReference: IGitHubSessionService['createRepositoryModelReference'] = + unsupported + @Unsupported + createPullRequestModelReference: IGitHubSessionService['createPullRequestModelReference'] = + unsupported + @Unsupported + createPullRequestReviewThreadsModelReference: IGitHubSessionService['createPullRequestReviewThreadsModelReference'] = + unsupported + @Unsupported + createPullRequestCIModelReference: IGitHubSessionService['createPullRequestCIModelReference'] = + unsupported + @Unsupported + createIssueModelReference: IGitHubSessionService['createIssueModelReference'] = unsupported + getChangedFiles: IGitHubSessionService['getChangedFiles'] = async () => [] + @Unsupported + getPullRequests: IGitHubSessionService['getPullRequests'] = unsupported + getPullRequestsWaitingForReview: IGitHubSessionService['getPullRequestsWaitingForReview'] = + async () => [] + getPullRequestsAssignedToViewer: IGitHubSessionService['getPullRequestsAssignedToViewer'] = + async () => [] + @Unsupported + getPullRequestContext: IGitHubSessionService['getPullRequestContext'] = unsupported + findPullRequestNumberByHeadBranch: IGitHubSessionService['findPullRequestNumberByHeadBranch'] = + async () => undefined + getRecentAssignedIssues: IGitHubSessionService['getRecentAssignedIssues'] = async () => [] + getRecentAuthoredPullRequests: IGitHubSessionService['getRecentAuthoredPullRequests'] = + async () => [] + getPullRequestReviewThreads: IGitHubSessionService['getPullRequestReviewThreads'] = async () => [] + getIssuesWithLinkedPullRequests: IGitHubSessionService['getIssuesWithLinkedPullRequests'] = + async () => new Set() +} + +registerSingleton(IGitHubSessionService, GitHubSessionService, InstantiationType.Delayed) + +class PullRequestIconCache implements IPullRequestIconCache { + _serviceBrand: undefined + get: IPullRequestIconCache['get'] = () => undefined + set: IPullRequestIconCache['set'] = () => {} +} + +registerSingleton(IPullRequestIconCache, PullRequestIconCache, InstantiationType.Delayed) + +class CloudSandboxTelemetryService implements ICloudSandboxTelemetryService { + _serviceBrand: undefined + reportRequest: ICloudSandboxTelemetryService['reportRequest'] = () => {} + reportCredentialRefreshStopped: ICloudSandboxTelemetryService['reportCredentialRefreshStopped'] = + () => {} +} + +registerSingleton( + ICloudSandboxTelemetryService, + CloudSandboxTelemetryService, + InstantiationType.Delayed +) + +class CloudSandboxApiService implements ICloudSandboxApiService { + _serviceBrand: undefined + @Unsupported + connect: ICloudSandboxApiService['connect'] = unsupported + @Unsupported + reconnect: ICloudSandboxApiService['reconnect'] = unsupported + @Unsupported + getEnvironment: ICloudSandboxApiService['getEnvironment'] = unsupported + @Unsupported + listSessions: ICloudSandboxApiService['listSessions'] = unsupported + @Unsupported + createSession: ICloudSandboxApiService['createSession'] = unsupported + getSessionHistory: ICloudSandboxApiService['getSessionHistory'] = async () => undefined +} + +registerSingleton(ICloudSandboxApiService, CloudSandboxApiService, InstantiationType.Delayed) + +class CloudSandboxAgentHostService implements ICloudSandboxAgentHostService { + _serviceBrand: undefined + @Unsupported + connect: ICloudSandboxAgentHostService['connect'] = unsupported + getSealedGitHubToken: ICloudSandboxAgentHostService['getSealedGitHubToken'] = () => undefined +} + +registerSingleton( + ICloudSandboxAgentHostService, + CloudSandboxAgentHostService, + InstantiationType.Delayed +) + +class DevContainerAgentHostService implements IDevContainerAgentHostService { + _serviceBrand: undefined + onDidChangeAvailability: IDevContainerAgentHostService['onDidChangeAvailability'] = Event.None + registerConnector: IDevContainerAgentHostService['registerConnector'] = () => Disposable.None + isAvailable: IDevContainerAgentHostService['isAvailable'] = async () => false + @Unsupported + connect: IDevContainerAgentHostService['connect'] = unsupported + disconnect: IDevContainerAgentHostService['disconnect'] = async () => {} +} + +registerSingleton( + IDevContainerAgentHostService, + DevContainerAgentHostService, + InstantiationType.Delayed +) + +class RemoteAgentHostConnectionCustomizationService implements IRemoteAgentHostConnectionCustomizationService { + _serviceBrand: undefined + register: IRemoteAgentHostConnectionCustomizationService['register'] = () => Disposable.None + get: IRemoteAgentHostConnectionCustomizationService['get'] = () => undefined +} + +registerSingleton( + IRemoteAgentHostConnectionCustomizationService, + RemoteAgentHostConnectionCustomizationService, + InstantiationType.Delayed +) + +class TunnelAgentHostService implements ITunnelAgentHostService { + _serviceBrand: undefined + onDidChangeTunnels: ITunnelAgentHostService['onDidChangeTunnels'] = Event.None + listTunnels: ITunnelAgentHostService['listTunnels'] = async () => [] + @Unsupported + getAutoConnectMode: ITunnelAgentHostService['getAutoConnectMode'] = unsupported + connect: ITunnelAgentHostService['connect'] = async () => {} + canDeleteTunnels: ITunnelAgentHostService['canDeleteTunnels'] = false + deleteTunnel: ITunnelAgentHostService['deleteTunnel'] = async () => {} + disconnect: ITunnelAgentHostService['disconnect'] = async () => {} + getCachedTunnels: ITunnelAgentHostService['getCachedTunnels'] = () => [] + cacheTunnel: ITunnelAgentHostService['cacheTunnel'] = () => {} + removeCachedTunnel: ITunnelAgentHostService['removeCachedTunnel'] = () => {} + isTunnelDismissed: ITunnelAgentHostService['isTunnelDismissed'] = () => false + dismissTunnel: ITunnelAgentHostService['dismissTunnel'] = () => {} + clearTunnelDismissal: ITunnelAgentHostService['clearTunnelDismissal'] = () => {} + isAutoConnectSuppressed: ITunnelAgentHostService['isAutoConnectSuppressed'] = () => false + suppressAutoConnect: ITunnelAgentHostService['suppressAutoConnect'] = () => {} + clearAutoConnectSuppression: ITunnelAgentHostService['clearAutoConnectSuppression'] = () => {} + getAuthProvider: ITunnelAgentHostService['getAuthProvider'] = async () => undefined +} + +registerSingleton(ITunnelAgentHostService, TunnelAgentHostService, InstantiationType.Delayed) + +class AgentHostFilterService implements IAgentHostFilterService { + _serviceBrand: undefined + onDidChange: IAgentHostFilterService['onDidChange'] = Event.None + onDidChangeDiscovering: IAgentHostFilterService['onDidChangeDiscovering'] = Event.None + selectedHostId: IAgentHostFilterService['selectedHostId'] = undefined + selectedHost: IAgentHostFilterService['selectedHost'] = undefined + hosts: IAgentHostFilterService['hosts'] = [] + isDiscovering: IAgentHostFilterService['isDiscovering'] = false + setSelectedHostId: IAgentHostFilterService['setSelectedHostId'] = () => {} + reconnect: IAgentHostFilterService['reconnect'] = () => {} + disconnect: IAgentHostFilterService['disconnect'] = () => {} + rediscover: IAgentHostFilterService['rediscover'] = async () => {} + registerDiscoveryHandler: IAgentHostFilterService['registerDiscoveryHandler'] = () => + Disposable.None + registerHostGroup: IAgentHostFilterService['registerHostGroup'] = () => Disposable.None +} + +registerSingleton(IAgentHostFilterService, AgentHostFilterService, InstantiationType.Delayed) + +class CustomViewService implements ICustomViewService { + _serviceBrand: undefined + activeCustomView: ICustomViewService['activeCustomView'] = constObservable(undefined) + registerCustomView: ICustomViewService['registerCustomView'] = () => Disposable.None + showCustomView: ICustomViewService['showCustomView'] = () => {} + hideCustomView: ICustomViewService['hideCustomView'] = () => {} +} + +registerSingleton(ICustomViewService, CustomViewService, InstantiationType.Delayed) + +class SessionContext implements ISessionContext { + _serviceBrand: undefined + session: ISessionContext['session'] = constObservable(undefined) +} + +registerSingleton(ISessionContext, SessionContext, InstantiationType.Delayed) + +class SessionGroupsService implements ISessionGroupsService { + _serviceBrand: undefined + onDidChange: ISessionGroupsService['onDidChange'] = Event.None + getGroups: ISessionGroupsService['getGroups'] = () => [] + getGroup: ISessionGroupsService['getGroup'] = () => undefined + @Unsupported + createGroup: ISessionGroupsService['createGroup'] = unsupported + renameGroup: ISessionGroupsService['renameGroup'] = () => {} + deleteGroup: ISessionGroupsService['deleteGroup'] = () => {} + addToGroup: ISessionGroupsService['addToGroup'] = () => {} + removeFromGroup: ISessionGroupsService['removeFromGroup'] = () => {} + getGroupOfSession: ISessionGroupsService['getGroupOfSession'] = () => undefined + getSessionIdsInGroup: ISessionGroupsService['getSessionIdsInGroup'] = () => [] + setPendingNewSessionGroup: ISessionGroupsService['setPendingNewSessionGroup'] = () => {} +} + +registerSingleton(ISessionGroupsService, SessionGroupsService, InstantiationType.Delayed) + +class SessionOpenTelemetryService implements ISessionOpenTelemetryService { + _serviceBrand: undefined + @Unsupported + withOpenRequest: ISessionOpenTelemetryService['withOpenRequest'] = unsupported + sessionResolved: ISessionOpenTelemetryService['sessionResolved'] = () => {} + sessionActivated: ISessionOpenTelemetryService['sessionActivated'] = () => {} + sessionLoaded: ISessionOpenTelemetryService['sessionLoaded'] = () => {} + modelBound: ISessionOpenTelemetryService['modelBound'] = () => {} + modelUnbound: ISessionOpenTelemetryService['modelUnbound'] = () => {} + modelBindFailed: ISessionOpenTelemetryService['modelBindFailed'] = () => {} +} + +registerSingleton( + ISessionOpenTelemetryService, + SessionOpenTelemetryService, + InstantiationType.Delayed +) + +class SessionSectionOrderService implements ISessionSectionOrderService { + _serviceBrand: undefined + onDidChange: ISessionSectionOrderService['onDidChange'] = Event.None + resolveOrder: ISessionSectionOrderService['resolveOrder'] = (defaultOrderedIds) => [ + ...defaultOrderedIds + ] + reorder: ISessionSectionOrderService['reorder'] = () => {} + isPromoted: ISessionSectionOrderService['isPromoted'] = () => false + retain: ISessionSectionOrderService['retain'] = () => {} +} + +registerSingleton( + ISessionSectionOrderService, + SessionSectionOrderService, + InstantiationType.Delayed +) + +class SessionsListModelService implements ISessionsListModelService { + _serviceBrand: undefined + onDidChange: ISessionsListModelService['onDidChange'] = Event.None + pinSession: ISessionsListModelService['pinSession'] = () => {} + unpinSession: ISessionsListModelService['unpinSession'] = () => {} + unpinSessions: ISessionsListModelService['unpinSessions'] = () => {} + isSessionPinned: ISessionsListModelService['isSessionPinned'] = () => false + migrateLegacyReadState: ISessionsListModelService['migrateLegacyReadState'] = () => {} + getSortKey: ISessionsListModelService['getSortKey'] = () => 0 + getNaturalSortKey: ISessionsListModelService['getNaturalSortKey'] = () => 0 + hasSortOverride: ISessionsListModelService['hasSortOverride'] = () => false + applySortChanges: ISessionsListModelService['applySortChanges'] = () => {} + @Unsupported + getStatusIcon: ISessionsListModelService['getStatusIcon'] = unsupported +} + +registerSingleton(ISessionsListModelService, SessionsListModelService, InstantiationType.Delayed) + +class SessionsManagementService implements ISessionsManagementService { + _serviceBrand: undefined + getSessions: ISessionsManagementService['getSessions'] = () => [] + getInFlightNewSessionRequests: ISessionsManagementService['getInFlightNewSessionRequests'] = + () => [] + getSession: ISessionsManagementService['getSession'] = () => undefined + resolveSessionResource: ISessionsManagementService['resolveSessionResource'] = async (resource) => + resource + getSessionForChatResource: ISessionsManagementService['getSessionForChatResource'] = () => + undefined + getAllSessionTypes: ISessionsManagementService['getAllSessionTypes'] = () => [] + getAllProviderSessionTypes: ISessionsManagementService['getAllProviderSessionTypes'] = () => [] + getSessionTypesForFolder: ISessionsManagementService['getSessionTypesForFolder'] = () => [] + getQuickChatSessionTypes: ISessionsManagementService['getQuickChatSessionTypes'] = () => [] + isNewSessionTargetAvailable: ISessionsManagementService['isNewSessionTargetAvailable'] = () => + false + isQuickChatTargetAvailable: ISessionsManagementService['isQuickChatTargetAvailable'] = () => false + resolveWorkspace: ISessionsManagementService['resolveWorkspace'] = () => undefined + onDidChangeSessionTypes: ISessionsManagementService['onDidChangeSessionTypes'] = Event.None + onDidChangeSessions: ISessionsManagementService['onDidChangeSessions'] = Event.None + onDidStartSession: ISessionsManagementService['onDidStartSession'] = Event.None + onWillSendRequest: ISessionsManagementService['onWillSendRequest'] = Event.None + onDidSendRequest: ISessionsManagementService['onDidSendRequest'] = Event.None + onDidArchiveSession: ISessionsManagementService['onDidArchiveSession'] = Event.None + onDidUnarchiveSession: ISessionsManagementService['onDidUnarchiveSession'] = Event.None + onDidDeleteSession: ISessionsManagementService['onDidDeleteSession'] = Event.None + onDidDeleteChat: ISessionsManagementService['onDidDeleteChat'] = Event.None + onDidRenameChat: ISessionsManagementService['onDidRenameChat'] = Event.None + onDidRenameSession: ISessionsManagementService['onDidRenameSession'] = Event.None + onDidReplaceSession: ISessionsManagementService['onDidReplaceSession'] = Event.None + onDidDiscardNewSession: ISessionsManagementService['onDidDiscardNewSession'] = Event.None + onDidReplaceNewDraftSession: ISessionsManagementService['onDidReplaceNewDraftSession'] = + Event.None + newSession: ISessionsManagementService['newSession'] = constObservable(undefined) + automationSession: ISessionsManagementService['automationSession'] = constObservable(undefined) + @Unsupported + createAutomationSession: ISessionsManagementService['createAutomationSession'] = unsupported + @Unsupported + createAutomationQuickChat: ISessionsManagementService['createAutomationQuickChat'] = unsupported + discardAutomationSession: ISessionsManagementService['discardAutomationSession'] = () => {} + getAutomationSessionConfiguration: ISessionsManagementService['getAutomationSessionConfiguration'] = + async () => undefined + supportsAutomationSessionConfiguration: ISessionsManagementService['supportsAutomationSessionConfiguration'] = + () => false + usesCombinedNewSessionConfigPicker: ISessionsManagementService['usesCombinedNewSessionConfigPicker'] = + () => false + @Unsupported + createNewSession: ISessionsManagementService['createNewSession'] = unsupported + @Unsupported + createQuickChat: ISessionsManagementService['createQuickChat'] = unsupported + createNewChatInSession: ISessionsManagementService['createNewChatInSession'] = async () => + undefined + @Unsupported + forkChatInSession: ISessionsManagementService['forkChatInSession'] = unsupported + @Unsupported + createSideChatInSession: ISessionsManagementService['createSideChatInSession'] = unsupported + discardNewSession: ISessionsManagementService['discardNewSession'] = () => {} + sendNewChatRequest: ISessionsManagementService['sendNewChatRequest'] = async () => {} + createAndSendNewChatRequest: ISessionsManagementService['createAndSendNewChatRequest'] = + async () => undefined + createAndSendQuickChatRequest: ISessionsManagementService['createAndSendQuickChatRequest'] = + async () => undefined + sendRequest: ISessionsManagementService['sendRequest'] = async () => {} + cancelCurrentRequest: ISessionsManagementService['cancelCurrentRequest'] = async () => {} + archiveSession: ISessionsManagementService['archiveSession'] = async () => {} + unarchiveSession: ISessionsManagementService['unarchiveSession'] = async () => {} + setSessionReadState: ISessionsManagementService['setSessionReadState'] = async () => {} + markRead: ISessionsManagementService['markRead'] = async () => {} + markUnread: ISessionsManagementService['markUnread'] = async () => {} + markAllRead: ISessionsManagementService['markAllRead'] = async () => {} + deleteSession: ISessionsManagementService['deleteSession'] = async () => {} + deleteSessions: ISessionsManagementService['deleteSessions'] = async () => {} + deleteChat: ISessionsManagementService['deleteChat'] = async () => {} + renameChat: ISessionsManagementService['renameChat'] = async () => {} + renameSession: ISessionsManagementService['renameSession'] = async () => {} + removeSessionArtifact: ISessionsManagementService['removeSessionArtifact'] = async () => {} +} + +registerSingleton(ISessionsManagementService, SessionsManagementService, InstantiationType.Delayed) + +class SessionsProvidersService implements ISessionsProvidersService { + _serviceBrand: undefined + onDidChangeProviders: ISessionsProvidersService['onDidChangeProviders'] = Event.None + registerProvider: ISessionsProvidersService['registerProvider'] = () => Disposable.None + getProviders: ISessionsProvidersService['getProviders'] = () => [] + getProvider: ISessionsProvidersService['getProvider'] = () => undefined +} + +registerSingleton(ISessionsProvidersService, SessionsProvidersService, InstantiationType.Delayed) + +class SessionsRecentWorkspacesService implements ISessionsRecentWorkspacesService { + _serviceBrand: undefined + onDidChangeRecentWorkspaces: ISessionsRecentWorkspacesService['onDidChangeRecentWorkspaces'] = + Event.None + @Unsupported + get historyLoadState(): ISessionsRecentWorkspacesService['historyLoadState'] { + return unsupported() + } + getRecentWorkspaces: ISessionsRecentWorkspacesService['getRecentWorkspaces'] = () => [] + addRecentWorkspace: ISessionsRecentWorkspacesService['addRecentWorkspace'] = () => {} + removeRecentWorkspace: ISessionsRecentWorkspacesService['removeRecentWorkspace'] = () => {} + clearCheckedWorkspace: ISessionsRecentWorkspacesService['clearCheckedWorkspace'] = () => {} + isNoWorkspaceChecked: ISessionsRecentWorkspacesService['isNoWorkspaceChecked'] = () => false + checkNoWorkspace: ISessionsRecentWorkspacesService['checkNoWorkspace'] = () => {} +} + +registerSingleton( + ISessionsRecentWorkspacesService, + SessionsRecentWorkspacesService, + InstantiationType.Delayed +) + +class SessionsService implements ISessionsService { + _serviceBrand: undefined + activeSession: ISessionsService['activeSession'] = constObservable(undefined) + visibleSessions: ISessionsService['visibleSessions'] = constObservable([]) + initialRestoreComplete: ISessionsService['initialRestoreComplete'] = constObservable(false) + navigationRequest: ISessionsService['navigationRequest'] = constObservable(undefined) + onDidToggleSessionStickiness: ISessionsService['onDidToggleSessionStickiness'] = Event.None + @Unsupported + getRecentlyOpenedSessions: ISessionsService['getRecentlyOpenedSessions'] = unsupported + showSession: ISessionsService['showSession'] = () => {} + openSession: ISessionsService['openSession'] = async () => {} + openSessionToSide: ISessionsService['openSessionToSide'] = async () => {} + openChatToSide: ISessionsService['openChatToSide'] = async () => {} + canOpenSession: ISessionsService['canOpenSession'] = async () => false + openChat: ISessionsService['openChat'] = async () => {} + closeChat: ISessionsService['closeChat'] = async () => {} + reopenLastClosedItem: ISessionsService['reopenLastClosedItem'] = async () => {} + @Unsupported + openNewSession: ISessionsService['openNewSession'] = unsupported + openQuickChat: ISessionsService['openQuickChat'] = () => undefined + openNewChatInSession: ISessionsService['openNewChatInSession'] = async () => {} + unsetNewSession: ISessionsService['unsetNewSession'] = () => {} + insertAt: ISessionsService['insertAt'] = () => {} + toggleSessionStickiness: ISessionsService['toggleSessionStickiness'] = () => {} + closeSession: ISessionsService['closeSession'] = () => {} + closeAllSessions: ISessionsService['closeAllSessions'] = () => {} + setActive: ISessionsService['setActive'] = () => {} + submitNewSessionInput: ISessionsService['submitNewSessionInput'] = async () => false + restoreVisibleSessions: ISessionsService['restoreVisibleSessions'] = async () => {} + openPreviousSession: ISessionsService['openPreviousSession'] = async () => {} + openNextSession: ISessionsService['openNextSession'] = async () => {} +} + +registerSingleton(ISessionsService, SessionsService, InstantiationType.Delayed) + +class SessionsWindowUsageService implements ISessionsWindowUsageService { + _serviceBrand: undefined + hadPriorWindowOpen: ISessionsWindowUsageService['hadPriorWindowOpen'] = false + windowOpenCount: ISessionsWindowUsageService['windowOpenCount'] = 0 +} + +registerSingleton( + ISessionsWindowUsageService, + SessionsWindowUsageService, + InstantiationType.Delayed +) + +class SessionChangesStatsCache implements ISessionChangesStatsCache { + _serviceBrand: undefined + get: ISessionChangesStatsCache['get'] = () => undefined + set: ISessionChangesStatsCache['set'] = () => {} +} + +registerSingleton(ISessionChangesStatsCache, SessionChangesStatsCache, InstantiationType.Delayed) + +class SplashStorageService implements ISplashStorageService { + _serviceBrand: undefined + + @Unsupported + saveWindowSplash = unsupported +} + +registerSingleton(ISplashStorageService, SplashStorageService, InstantiationType.Delayed) + +class McpDevModeDebugging implements IMcpDevModeDebugging { + _serviceBrand: undefined + + @Unsupported + transform: IMcpDevModeDebugging['transform'] = unsupported +} + +registerSingleton(IMcpDevModeDebugging, McpDevModeDebugging, InstantiationType.Delayed) From 2f9b19cf2e61f02526dc5937130588783eafba12 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:21:54 +0200 Subject: [PATCH 03/35] feat: stop removing session part of VSCode --- scripts/install-vscode | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/scripts/install-vscode b/scripts/install-vscode index ff974a88..6674ae9d 100755 --- a/scripts/install-vscode +++ b/scripts/install-vscode @@ -46,9 +46,8 @@ cd .. cd src rm -rf `find . -name '*.test.ts' -o -name 'test' -o -name 'electron-main' -o -name 'electron-browser' -o -name 'electron-utility' -o -name 'node'` rm -f bootstrap*.ts *main.ts *cli.ts -rm -f vs/workbench/workbench.desktop.main.ts +rm -f vs/workbench/workbench.desktop.main.ts vs/sessions/sessions.desktop.main.ts rm -rf vs/code -find vs/sessions -type f ! \( -path "vs/sessions/common/theme.ts" -o -path "vs/sessions/common/sizes.ts" -o -path "vs/sessions/common/layoutConstants.ts" \) -delete cd .. echo "Extracting service identifiers" @@ -97,6 +96,9 @@ NODE_OPTIONS=--max-old-space-size=8192 npx tsc --declaration --importHelpers --o # Copy files that are already built and assets find ./ \( -name '*.js' -o -name '*.d.ts' -o -name '*.ttf' -o -name '*.css' -o -name '*.mp3' -o -name '*.scm' -o -name '*.svg' -o -name '*.png' -o -name '*.html' -o -name '*.sh' -o -name '*.zsh' -o -name '*.ps1' \) -exec rsync -R \{\} "$output_directory/src" \; +# bundle & copy the devTunnelsWebEntry module +npm run bundle-dev-tunnels-web -- --out $output_directory/src/vs/sessions/contrib/providers/remoteAgentHost/browser + cd .. cp package.json product.json $output_directory # Copy editor types From d54aa4e8edd124be025e4a4b43332ab8fbd737cd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:24:15 +0200 Subject: [PATCH 04/35] feat: split elevant service overrides into classic/session implementations --- src/service-override/bulkEdit/classic.ts | 2 + .../{bulkEdit.ts => bulkEdit/common.ts} | 1 - src/service-override/bulkEdit/session.ts | 1 + src/service-override/chat/classic.ts | 115 ++++ .../{chat.ts => chat/common.ts} | 510 +++++++----------- src/service-override/chat/session.ts | 82 +++ .../classic.ts} | 10 +- src/service-override/configuration/session.ts | 218 ++++++++ .../{debug.ts => debug/classic.ts} | 2 +- src/service-override/debug/session.ts | 22 + src/service-override/dialogs/classic.ts | 2 + .../{dialogs.ts => dialogs/common.ts} | 1 - src/service-override/dialogs/session.ts | 2 + src/service-override/editor/classic.ts | 22 + .../{editor.ts => editor/common.ts} | 43 +- src/service-override/editor/session.ts | 23 + .../extensionGallery/classic.ts | 30 ++ .../common.ts} | 37 +- .../extensionGallery/session.ts | 23 + .../{github.ts => github/classic.ts} | 0 src/service-override/github/session.ts | 11 + src/service-override/keybindings.ts | 4 +- .../{markers.ts => markers/classic.ts} | 0 src/service-override/markers/session.ts | 5 + src/service-override/mcp/classic.ts | 2 + .../{mcp.ts => mcp/common.ts} | 1 - src/service-override/mcp/session.ts | 1 + src/service-override/outline/classic.ts | 2 + .../{outline.ts => outline/common.ts} | 3 +- src/service-override/outline/session.ts | 1 + src/service-override/policy/classic.ts | 3 + .../{policy.ts => policy/common.ts} | 1 - src/service-override/policy/session.ts | 2 + src/service-override/scm/classic.ts | 4 + .../{scm.ts => scm/common.ts} | 1 - src/service-override/scm/session.ts | 2 + src/service-override/search/classic.ts | 17 + .../{search.ts => search/common.ts} | 12 +- src/service-override/search/session.ts | 8 + .../{snippets.ts => snippets/classic.ts} | 4 +- src/service-override/snippets/session.ts | 3 + src/service-override/survey/classic.ts | 3 + .../{survey.ts => survey/common.ts} | 2 - src/service-override/survey/session.ts | 1 + src/service-override/telemetry/classic.ts | 3 + .../{telemetry.ts => telemetry/common.ts} | 2 - src/service-override/telemetry/session.ts | 1 + .../{testing.ts => testing/classic.ts} | 2 +- src/service-override/testing/session.ts | 18 + src/service-override/timeline/classic.ts | 2 + .../{timeline.ts => timeline/common.ts} | 3 +- src/service-override/timeline/session.ts | 1 + src/service-override/userDataSync/classic.ts | 2 + .../common.ts} | 3 +- src/service-override/userDataSync/session.ts | 1 + src/service-override/viewCommon/classic.ts | 15 + .../{viewCommon.ts => viewCommon/common.ts} | 125 +++-- src/service-override/viewCommon/session.ts | 18 + .../classic.ts} | 2 +- src/service-override/viewTitleBar/session.ts | 15 + .../{views.ts => views/classic.ts} | 19 +- src/service-override/views/session.ts | 3 + .../classic.ts} | 7 +- src/service-override/walkthrough/session.ts | 3 + src/service-override/welcome/classic.ts | 14 + .../{welcome.ts => welcome/common.ts} | 5 - src/service-override/welcome/session.ts | 8 + .../{workbench.ts => workbench/classic.ts} | 55 +- src/service-override/workbench/common.ts | 19 + src/service-override/workbench/session.ts | 353 ++++++++++++ 70 files changed, 1437 insertions(+), 501 deletions(-) create mode 100644 src/service-override/bulkEdit/classic.ts rename src/service-override/{bulkEdit.ts => bulkEdit/common.ts} (87%) create mode 100644 src/service-override/bulkEdit/session.ts create mode 100644 src/service-override/chat/classic.ts rename src/service-override/{chat.ts => chat/common.ts} (85%) create mode 100644 src/service-override/chat/session.ts rename src/service-override/{configuration.ts => configuration/classic.ts} (97%) create mode 100644 src/service-override/configuration/session.ts rename src/service-override/{debug.ts => debug/classic.ts} (98%) create mode 100644 src/service-override/debug/session.ts create mode 100644 src/service-override/dialogs/classic.ts rename src/service-override/{dialogs.ts => dialogs/common.ts} (94%) create mode 100644 src/service-override/dialogs/session.ts create mode 100644 src/service-override/editor/classic.ts rename src/service-override/{editor.ts => editor/common.ts} (88%) create mode 100644 src/service-override/editor/session.ts create mode 100644 src/service-override/extensionGallery/classic.ts rename src/service-override/{extensionGallery.ts => extensionGallery/common.ts} (89%) create mode 100644 src/service-override/extensionGallery/session.ts rename src/service-override/{github.ts => github/classic.ts} (100%) create mode 100644 src/service-override/github/session.ts rename src/service-override/{markers.ts => markers/classic.ts} (100%) create mode 100644 src/service-override/markers/session.ts create mode 100644 src/service-override/mcp/classic.ts rename src/service-override/{mcp.ts => mcp/common.ts} (98%) create mode 100644 src/service-override/mcp/session.ts create mode 100644 src/service-override/outline/classic.ts rename src/service-override/{outline.ts => outline/common.ts} (89%) create mode 100644 src/service-override/outline/session.ts create mode 100644 src/service-override/policy/classic.ts rename src/service-override/{policy.ts => policy/common.ts} (94%) create mode 100644 src/service-override/policy/session.ts create mode 100644 src/service-override/scm/classic.ts rename src/service-override/{scm.ts => scm/common.ts} (96%) create mode 100644 src/service-override/scm/session.ts create mode 100644 src/service-override/search/classic.ts rename src/service-override/{search.ts => search/common.ts} (89%) create mode 100644 src/service-override/search/session.ts rename src/service-override/{snippets.ts => snippets/classic.ts} (90%) create mode 100644 src/service-override/snippets/session.ts create mode 100644 src/service-override/survey/classic.ts rename src/service-override/{survey.ts => survey/common.ts} (64%) create mode 100644 src/service-override/survey/session.ts create mode 100644 src/service-override/telemetry/classic.ts rename src/service-override/{telemetry.ts => telemetry/common.ts} (84%) create mode 100644 src/service-override/telemetry/session.ts rename src/service-override/{testing.ts => testing/classic.ts} (98%) create mode 100644 src/service-override/testing/session.ts create mode 100644 src/service-override/timeline/classic.ts rename src/service-override/{timeline.ts => timeline/common.ts} (89%) create mode 100644 src/service-override/timeline/session.ts create mode 100644 src/service-override/userDataSync/classic.ts rename src/service-override/{userDataSync.ts => userDataSync/common.ts} (95%) create mode 100644 src/service-override/userDataSync/session.ts create mode 100644 src/service-override/viewCommon/classic.ts rename src/service-override/{viewCommon.ts => viewCommon/common.ts} (91%) create mode 100644 src/service-override/viewCommon/session.ts rename src/service-override/{viewTitleBar.ts => viewTitleBar/classic.ts} (89%) create mode 100644 src/service-override/viewTitleBar/session.ts rename src/service-override/{views.ts => views/classic.ts} (98%) create mode 100644 src/service-override/views/session.ts rename src/service-override/{walkthrough.ts => walkthrough/classic.ts} (95%) create mode 100644 src/service-override/walkthrough/session.ts create mode 100644 src/service-override/welcome/classic.ts rename src/service-override/{welcome.ts => welcome/common.ts} (62%) create mode 100644 src/service-override/welcome/session.ts rename src/service-override/{workbench.ts => workbench/classic.ts} (78%) create mode 100644 src/service-override/workbench/common.ts create mode 100644 src/service-override/workbench/session.ts diff --git a/src/service-override/bulkEdit/classic.ts b/src/service-override/bulkEdit/classic.ts new file mode 100644 index 00000000..47304065 --- /dev/null +++ b/src/service-override/bulkEdit/classic.ts @@ -0,0 +1,2 @@ +export { default } from './common' +import 'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution' diff --git a/src/service-override/bulkEdit.ts b/src/service-override/bulkEdit/common.ts similarity index 87% rename from src/service-override/bulkEdit.ts rename to src/service-override/bulkEdit/common.ts index 0ef52439..7bab1da8 100644 --- a/src/service-override/bulkEdit.ts +++ b/src/service-override/bulkEdit/common.ts @@ -2,7 +2,6 @@ import { type IEditorOverrideServices } from 'vs/editor/standalone/browser/stand import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { IBulkEditService } from 'vs/editor/browser/services/bulkEditService.service' import { BulkEditService } from 'vs/workbench/contrib/bulkEdit/browser/bulkEditService' -import 'vs/workbench/contrib/bulkEdit/browser/preview/bulkEdit.contribution' export default function getServiceOverride(): IEditorOverrideServices { return { diff --git a/src/service-override/bulkEdit/session.ts b/src/service-override/bulkEdit/session.ts new file mode 100644 index 00000000..4a864cf7 --- /dev/null +++ b/src/service-override/bulkEdit/session.ts @@ -0,0 +1 @@ +export { default } from './common' diff --git a/src/service-override/chat/classic.ts b/src/service-override/chat/classic.ts new file mode 100644 index 00000000..b2b2739c --- /dev/null +++ b/src/service-override/chat/classic.ts @@ -0,0 +1,115 @@ +import type { IDefaultAccount } from 'vs/base/common/defaultAccount' +import { Event } from 'vs/base/common/event' +import { type IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { RemoteAgentHostService } from 'vs/platform/agentHost/browser/remoteAgentHostServiceImpl' +import { IRemoteAgentHostService } from 'vs/platform/agentHost/common/remoteAgentHostService.service' +import { MANAGED_SETTINGS_FRESHNESS_NOT_REQUIRED } from 'vs/platform/defaultAccount/common/defaultAccount' +import { IDefaultAccountService } from 'vs/platform/defaultAccount/common/defaultAccount.service' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { AgentsVoiceWindowService } from 'vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService' +import { IAgentsVoiceWindowService } from 'vs/workbench/contrib/agentsVoice/common/agentsVoice.service' +import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution' +import { NullAgentHostCustomizationService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService' +import { IAgentHostCustomizationService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.service' +import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution' +import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution' +import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution' +import { AICustomizationWorkspaceService } from 'vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService' +import { CustomizationHarnessService } from 'vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService' +import 'vs/workbench/contrib/chat/browser/chat.contribution' +import 'vs/workbench/contrib/chat/browser/chat.view.contribution' +import { IAICustomizationWorkspaceService } from 'vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service' +import { ICustomizationHarnessService } from 'vs/workbench/contrib/chat/common/customizationHarnessService.service' +import { IPromptsService } from 'vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service' +import { PromptsService } from 'vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl' +import 'vs/workbench/contrib/inlineChat/browser/inlineChat.contribution' +import { InlineChatSessionResolver } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSessionResolver' +import { IInlineChatSessionResolver } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSessionResolver.service' +import { IInlineChatSessionService } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service' +import { InlineChatSessionServiceImpl } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl' +import { + ChatEntitlement, + type IChatEntitlementContextState +} from 'vs/workbench/services/chat/common/chatEntitlementService' +import getCommonServiceOverride from './common.js' +export type { ITelemetryData, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry' + +class DefaultAccountService implements IDefaultAccountService { + declare _serviceBrand: undefined + constructor(private defaultAccount: IDefaultAccount | null) {} + + resolveGitHubUrl: IDefaultAccountService['resolveGitHubUrl'] = (path) => path + currentDefaultAccount: IDefaultAccountService['currentDefaultAccount'] = null + + onDidChangePolicyData: IDefaultAccountService['onDidChangePolicyData'] = Event.None + policyData: IDefaultAccountService['policyData'] = null + managedSettingsFetchStatus: IDefaultAccountService['managedSettingsFetchStatus'] = null + managedSettingsFetchedAt: IDefaultAccountService['managedSettingsFetchedAt'] = null + managedSettingsRawResponse: IDefaultAccountService['managedSettingsRawResponse'] = undefined + managedSettingsCompatibilityError: IDefaultAccountService['managedSettingsCompatibilityError'] = + null + onDidChangeManagedSettingsCompatibilityError: IDefaultAccountService['onDidChangeManagedSettingsCompatibilityError'] = + Event.None + managedSettingsFreshness: IDefaultAccountService['managedSettingsFreshness'] = + MANAGED_SETTINGS_FRESHNESS_NOT_REQUIRED + onDidChangeManagedSettingsFreshness: IDefaultAccountService['onDidChangeManagedSettingsFreshness'] = + Event.None + + getDefaultAccountAuthenticationProvider: IDefaultAccountService['getDefaultAccountAuthenticationProvider'] = + () => ({ id: 'default', name: 'Default', enterprise: false }) + setDefaultAccountProvider: IDefaultAccountService['setDefaultAccountProvider'] = () => {} + refresh: IDefaultAccountService['refresh'] = async () => null + signIn: IDefaultAccountService['signIn'] = async () => null + + readonly onDidChangeDefaultAccount: IDefaultAccountService['onDidChangeDefaultAccount'] = + Event.None + + getDefaultAccount: IDefaultAccountService['getDefaultAccount'] = async () => this.defaultAccount + + copilotTokenInfo: IDefaultAccountService['copilotTokenInfo'] = null + onDidChangeCopilotTokenInfo: IDefaultAccountService['onDidChangeCopilotTokenInfo'] = Event.None + signOut: IDefaultAccountService['signOut'] = async () => {} +} + +export interface ChatServiceOverrideOptions { + defaultAccount?: IDefaultAccount +} + +export default function getServiceOverride({ + defaultAccount +}: ChatServiceOverrideOptions = {}): IEditorOverrideServices { + return { + ...getCommonServiceOverride(), + [IInlineChatSessionService.toString()]: new SyncDescriptor( + InlineChatSessionServiceImpl, + [], + true + ), + [IPromptsService.toString()]: new SyncDescriptor(PromptsService, [], true), + [IAICustomizationWorkspaceService.toString()]: new SyncDescriptor( + AICustomizationWorkspaceService, + [], + true + ), + [IDefaultAccountService.toString()]: new SyncDescriptor( + DefaultAccountService, + [defaultAccount], + true + ), + [ICustomizationHarnessService.toString()]: new SyncDescriptor( + CustomizationHarnessService, + [], + true + ), + [IRemoteAgentHostService.toString()]: new SyncDescriptor(RemoteAgentHostService, [], true), + [IAgentsVoiceWindowService.toString()]: new SyncDescriptor(AgentsVoiceWindowService, [], true), + [IAgentHostCustomizationService.toString()]: new SyncDescriptor( + NullAgentHostCustomizationService, + [], + true + ), + [IInlineChatSessionResolver.toString()]: new SyncDescriptor(InlineChatSessionResolver, [], true) + } +} + +export { ChatEntitlement, type IChatEntitlementContextState, type IDefaultAccount } diff --git a/src/service-override/chat.ts b/src/service-override/chat/common.ts similarity index 85% rename from src/service-override/chat.ts rename to src/service-override/chat/common.ts index b046dc11..179f56f7 100644 --- a/src/service-override/chat.ts +++ b/src/service-override/chat/common.ts @@ -1,15 +1,160 @@ -import { type IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import type { IDefaultAccount } from 'vs/base/common/defaultAccount' +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { AgentHostConnectionsService } from 'vs/platform/agentHost/browser/agentHostConnectionsService' +import { IAgentHostConnectionsService } from 'vs/platform/agentHost/common/agentHostConnectionsService.service' +import { IAgentHostEnablementService } from 'vs/platform/agentHost/common/agentHostEnablementService.service' +import { IAgentHostResourceService } from 'vs/platform/agentHost/common/agentHostResourceService.service' +import { IAgentHostService } from 'vs/platform/agentHost/common/agentService.service' +import { ILinkPresentationService } from 'vs/platform/dataChannel/common/dataChannel.service' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { AgentNetworkFilterService } from 'vs/platform/networkFilter/common/networkFilterService' +import { IAgentNetworkFilterService } from 'vs/platform/networkFilter/common/networkFilterService.service' +import { NullSandboxHelperService } from 'vs/platform/sandbox/browser/sandboxHelperService' +import { ISandboxHelperService } from 'vs/platform/sandbox/common/sandboxHelperService.service' +import { VoiceModeOnboardingService } from 'vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding' +import { IVoiceModeOnboardingService } from 'vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.service' +import { VoiceTranscriptStore } from 'vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore' +import { IVoiceTranscriptStore } from 'vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.service' +import { ChatAccessibilityService } from 'vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService' +import { BrowserAgentHostDebugLogsExportService } from 'vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction' +import { IAgentHostDebugLogsExportService } from 'vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.service' +import { AgentPluginRepositoryService } from 'vs/workbench/contrib/chat/browser/agentPluginRepositoryService' +import { AgentHostActiveClientService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService' +import { IAgentHostActiveClientService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service' +import { AgentHostImportConversationStore } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostImportConversationStore' +import { IAgentHostImportConversationStore } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostImportConversationStore.service' +import { AgentHostNewSessionFolderService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService' +import { IAgentHostNewSessionFolderService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.service' +import { AgentHostProtectedResourcesService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService' +import { IAgentHostProtectedResourcesService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.service' +import { AgentHostSessionWorkingDirectoryResolver } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver' +import { IAgentHostSessionWorkingDirectoryResolver } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.service' +import { AgentHostSessionWorkingDirectorySynchronizer } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer' +import { IAgentHostSessionWorkingDirectorySynchronizer } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.service' +import { AgentHostShellInitSynchronizer } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer' +import { IAgentHostShellInitSynchronizer } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.service' +import { AgentHostToolSetEnablementService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService' +import { IAgentHostToolSetEnablementService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.service' +import { AgentHostUntitledProvisionalSessionService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService' +import { IAgentHostUntitledProvisionalSessionService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.service' +import { AgentSessionsService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService' +import { IAgentSessionsService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service' +import { AgentSessionProjectionService } from 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService' +import { IAgentSessionProjectionService } from 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.service' +import { AgentTitleBarStatusService } from 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusService' +import { IAgentTitleBarStatusService } from 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusService.service' +import { SessionSummaryHoverService } from 'vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService' +import { ISessionSummaryHoverService } from 'vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.service' +import { CustomizationMigrationService } from 'vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl' +import { ChatAttachmentResolveService } from 'vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService' +import { IChatAttachmentResolveService } from 'vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.service' +import { ChatAttachmentWidgetRegistry } from 'vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry' +import { IChatAttachmentWidgetRegistry } from 'vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry.service' +import { ChatContextPickService } from 'vs/workbench/contrib/chat/browser/attachments/chatContextPickService' +import { IChatContextPickService } from 'vs/workbench/contrib/chat/browser/attachments/chatContextPickService.service' +import { ChatPasteTargetService } from 'vs/workbench/contrib/chat/browser/attachments/chatPasteTargetService' +import { ChatVariablesService } from 'vs/workbench/contrib/chat/browser/attachments/chatVariables' import { IChatAccessibilityService, IChatCodeBlockContextProviderService, + IChatPasteTargetService, IChatWidgetService, IQuickChatService } from 'vs/workbench/contrib/chat/browser/chat.service' -import { ChatAccessibilityService } from 'vs/workbench/contrib/chat/browser/accessibility/chatAccessibilityService' -import { QuickChatService } from 'vs/workbench/contrib/chat/browser/widgetHosts/chatQuick' -import { ChatVariablesService } from 'vs/workbench/contrib/chat/browser/attachments/chatVariables' +import 'vs/workbench/contrib/chat/browser/chat.shared.contribution' +import { ChatEditingExplanationModelManager } from 'vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager' +import { IChatEditingExplanationModelManager } from 'vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.service' +import { ChatEditingService } from 'vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl' +import { ChatGoalSummaryService } from 'vs/workbench/contrib/chat/browser/chatGoalSummaryService' +import { IChatGoalSummaryService } from 'vs/workbench/contrib/chat/browser/chatGoalSummaryService.service' +import { ChatImageCarouselService } from 'vs/workbench/contrib/chat/browser/chatImageCarouselService' +import { IChatImageCarouselService } from 'vs/workbench/contrib/chat/browser/chatImageCarouselService.service' +import { ChatOutputRendererService } from 'vs/workbench/contrib/chat/browser/chatOutputItemRenderer' +import { IChatOutputRendererService } from 'vs/workbench/contrib/chat/browser/chatOutputItemRenderer.service' +import { ChatPetService } from 'vs/workbench/contrib/chat/browser/chatPetService' +import { IChatPetService } from 'vs/workbench/contrib/chat/browser/chatPetService.service' +import { IChatResponseFileChangesService } from 'vs/workbench/contrib/chat/browser/chatResponseFileChangesService.service' +import { ChatSessionsService } from 'vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution' +import { ChatStatusItemService } from 'vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService' +import { IChatStatusItemService } from 'vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService.service' +import { ChatSubmitRequestHandlerService } from 'vs/workbench/contrib/chat/browser/chatSubmitRequestHandlerService' +import { IChatSubmitRequestHandlerService } from 'vs/workbench/contrib/chat/browser/chatSubmitRequestHandlerService.service' +import { ChatTipService } from 'vs/workbench/contrib/chat/browser/chatTipService' +import { IChatTipService } from 'vs/workbench/contrib/chat/browser/chatTipService.service' import { ChatCodeBlockContextProviderService } from 'vs/workbench/contrib/chat/browser/codeBlockContextProviderService' +import { ChatContextService } from 'vs/workbench/contrib/chat/browser/contextContrib/chatContextService' +import { IChatContextService } from 'vs/workbench/contrib/chat/browser/contextContrib/chatContextService.service' +import { EditorChatResponseFileChangesService } from 'vs/workbench/contrib/chat/browser/editorChatResponseFileChangesService' +import { ChatModelFeedbackSurveyService } from 'vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyService' +import { IChatModelFeedbackSurveyService } from 'vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyService.service' +import { LanguageModelsConfigurationService } from 'vs/workbench/contrib/chat/browser/languageModelsConfigurationService' +import { PlanReviewFeedbackService } from 'vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService' +import { IPlanReviewFeedbackService } from 'vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.service' +import { BrowserPluginGitCommandService } from 'vs/workbench/contrib/chat/browser/pluginGitCommandService' +import { PluginInstallService } from 'vs/workbench/contrib/chat/browser/pluginInstallService' +import { ChatSpeechToTextService } from 'vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService' +import { IChatSpeechToTextService } from 'vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService.service' +import { DictationOnboardingService } from 'vs/workbench/contrib/chat/browser/speechToText/dictationOnboarding' +import { IDictationOnboardingService } from 'vs/workbench/contrib/chat/browser/speechToText/dictationOnboarding.service' +import { VoiceCodeTranscriptionClient } from 'vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient' +import { IVoiceCodeTranscriptionClient } from 'vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.service' +import { ChatToolRiskAssessmentService } from 'vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService' +import { IChatToolRiskAssessmentService } from 'vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.service' +import { LanguageModelToolsConfirmationService } from 'vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService' +import { LanguageModelToolsService } from 'vs/workbench/contrib/chat/browser/tools/languageModelToolsService' +import { ToolResultCompressorService } from 'vs/workbench/contrib/chat/browser/tools/toolResultCompressorService' +import { MicCaptureService } from 'vs/workbench/contrib/chat/browser/voiceClient/micCaptureService' +import { IMicCaptureService } from 'vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.service' +import { TtsPlaybackService } from 'vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService' +import { ITtsPlaybackService } from 'vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.service' +import { VoiceClientService } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceClientService' +import { VoiceSessionController } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController' +import { IVoiceSessionController } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.service' +import { VoiceToolDispatchService } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService' +import { IVoiceToolDispatchService } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.service' +import { VoiceInputModeService } from 'vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode' +import { IVoiceInputModeService } from 'vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.service' +import { ChatMarkdownAnchorService } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService' +import { IChatMarkdownAnchorService } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.service' +import { ChatOutputPartStateCache } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatOutputPartStateCache' +import { IChatOutputPartStateCache } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatOutputPartStateCache.service' +import { CodeCompareModelService } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart' +import { ICodeCompareModelService } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.service' +import { ChatLayoutService } from 'vs/workbench/contrib/chat/browser/widget/chatLayoutService' +import { ChatPetWidgetService } from 'vs/workbench/contrib/chat/browser/widget/chatPetWidgetService' +import { IChatPetWidgetService } from 'vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.service' +import { ChatWidgetService } from 'vs/workbench/contrib/chat/browser/widget/chatWidgetService' +import { ChatInputNoticeHubService } from 'vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub' +import { IChatInputNoticeHubService } from 'vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.service' +import { ChatInputNotificationService } from 'vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService' +import { IChatInputNotificationService } from 'vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.service' +import { ChatPhoneInputPresenterService } from 'vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter' +import { IChatPhoneInputPresenter } from 'vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.service' +import { QuickChatService } from 'vs/workbench/contrib/chat/browser/widgetHosts/chatQuick' +import { IChatVariablesService } from 'vs/workbench/contrib/chat/common/attachments/chatVariables.service' +import { IChatDebugService } from 'vs/workbench/contrib/chat/common/chatDebugService.service' +import { ChatDebugServiceImpl } from 'vs/workbench/contrib/chat/common/chatDebugServiceImpl' +import { ChatModeService } from 'vs/workbench/contrib/chat/common/chatModes' +import { IChatModeService } from 'vs/workbench/contrib/chat/common/chatModes.service' +import { ChatRequestOriginService } from 'vs/workbench/contrib/chat/common/chatRequestOrigin' +import { IChatRequestOriginService } from 'vs/workbench/contrib/chat/common/chatRequestOrigin.service' +import { IChatService } from 'vs/workbench/contrib/chat/common/chatService/chatService.service' +import { ChatService } from 'vs/workbench/contrib/chat/common/chatService/chatServiceImpl' +import { IChatSessionsService } from 'vs/workbench/contrib/chat/common/chatSessionsService.service' +import { ChatSideChatService } from 'vs/workbench/contrib/chat/common/chatSideChatService' +import { IChatSideChatService } from 'vs/workbench/contrib/chat/common/chatSideChatService.service' +import { CodeMapperService } from 'vs/workbench/contrib/chat/common/editing/chatCodeMapperService' +import { ICodeMapperService } from 'vs/workbench/contrib/chat/common/editing/chatCodeMapperService.service' +import { IChatEditingService } from 'vs/workbench/contrib/chat/common/editing/chatEditingService.service' +import { LanguageModelIgnoredFilesService } from 'vs/workbench/contrib/chat/common/ignoredFiles' +import { ILanguageModelIgnoredFilesService } from 'vs/workbench/contrib/chat/common/ignoredFiles.service' +import { LanguageModelStatsService } from 'vs/workbench/contrib/chat/common/languageModelStats' +import { ILanguageModelStatsService } from 'vs/workbench/contrib/chat/common/languageModelStats.service' +import { LanguageModelsService } from 'vs/workbench/contrib/chat/common/languageModels' +import { ILanguageModelsService } from 'vs/workbench/contrib/chat/common/languageModels.service' +import { ILanguageModelsConfigurationService } from 'vs/workbench/contrib/chat/common/languageModelsConfiguration.service' +import { ChatTransferService } from 'vs/workbench/contrib/chat/common/model/chatTransferService' +import { IChatTransferService } from 'vs/workbench/contrib/chat/common/model/chatTransferService.service' import { ChatAgentNameService, ChatAgentService @@ -18,296 +163,82 @@ import { IChatAgentNameService, IChatAgentService } from 'vs/workbench/contrib/chat/common/participants/chatAgents.service' -import { IChatService } from 'vs/workbench/contrib/chat/common/chatService/chatService.service' -import { ChatService } from 'vs/workbench/contrib/chat/common/chatService/chatServiceImpl' import { ChatSlashCommandService } from 'vs/workbench/contrib/chat/common/participants/chatSlashCommands' import { IChatSlashCommandService } from 'vs/workbench/contrib/chat/common/participants/chatSlashCommands.service' -import { IChatVariablesService } from 'vs/workbench/contrib/chat/common/attachments/chatVariables.service' -import { ChatWidgetHistoryService } from 'vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService' -import { IChatWidgetHistoryService } from 'vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.service' -import { ILanguageModelStatsService } from 'vs/workbench/contrib/chat/common/languageModelStats.service' -import { LanguageModelsService } from 'vs/workbench/contrib/chat/common/languageModels' -import { ILanguageModelsService } from 'vs/workbench/contrib/chat/common/languageModels.service' -import { IInlineChatSessionService } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service' -import { InlineChatSessionServiceImpl } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl' -import { LanguageModelStatsService } from 'vs/workbench/contrib/chat/common/languageModelStats' -import { ILanguageModelToolsService } from 'vs/workbench/contrib/chat/common/tools/languageModelToolsService.service' -import { LanguageModelToolsService } from 'vs/workbench/contrib/chat/browser/tools/languageModelToolsService' -import { ICodeMapperService } from 'vs/workbench/contrib/chat/common/editing/chatCodeMapperService.service' -import { CodeMapperService } from 'vs/workbench/contrib/chat/common/editing/chatCodeMapperService' -import { IChatEditingService } from 'vs/workbench/contrib/chat/common/editing/chatEditingService.service' -import { LanguageModelIgnoredFilesService } from 'vs/workbench/contrib/chat/common/ignoredFiles' -import { ILanguageModelIgnoredFilesService } from 'vs/workbench/contrib/chat/common/ignoredFiles.service' -import { IChatMarkdownAnchorService } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService.service' -import { ChatMarkdownAnchorService } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatMarkdownAnchorService' -import { ChatEditingService } from 'vs/workbench/contrib/chat/browser/chatEditing/chatEditingServiceImpl' -import { - ChatEntitlementService, - ChatEntitlement, - type IChatEntitlementContextState -} from 'vs/workbench/services/chat/common/chatEntitlementService' -import { PromptsService } from 'vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl' -import { IChatEntitlementService } from 'vs/workbench/services/chat/common/chatEntitlementService.service' -import { IPromptsService } from 'vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service' -import { IChatTransferService } from 'vs/workbench/contrib/chat/common/model/chatTransferService.service' -import { ChatTransferService } from 'vs/workbench/contrib/chat/common/model/chatTransferService' -import { IChatContextPickService } from 'vs/workbench/contrib/chat/browser/attachments/chatContextPickService.service' -import { ChatContextPickService } from 'vs/workbench/contrib/chat/browser/attachments/chatContextPickService' -import { IChatAttachmentResolveService } from 'vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService.service' -import { ChatAttachmentResolveService } from 'vs/workbench/contrib/chat/browser/attachments/chatAttachmentResolveService' -import { IRemoteCodingAgentsService } from 'vs/workbench/contrib/remoteCodingAgents/common/remoteCodingAgentsService.service' -import { RemoteCodingAgentsService } from 'vs/workbench/contrib/remoteCodingAgents/common/remoteCodingAgentsService' -import { IChatSessionsService } from 'vs/workbench/contrib/chat/common/chatSessionsService.service' -import { ChatSessionsService } from 'vs/workbench/contrib/chat/browser/chatSessions/chatSessions.contribution' -import { ChatOutputRendererService } from 'vs/workbench/contrib/chat/browser/chatOutputItemRenderer' -import { IChatOutputRendererService } from 'vs/workbench/contrib/chat/browser/chatOutputItemRenderer.service' -import { IChatTodoListService } from 'vs/workbench/contrib/chat/common/tools/chatTodoListService.service' +import { IAgentPluginRepositoryService } from 'vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service' +import { IAgentPluginService } from 'vs/workbench/contrib/chat/common/plugins/agentPluginService.service' +import { AgentPluginService } from 'vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl' +import { IPluginGitService } from 'vs/workbench/contrib/chat/common/plugins/pluginGitService.service' +import { IPluginInstallService } from 'vs/workbench/contrib/chat/common/plugins/pluginInstallService.service' +import { PluginMarketplaceService } from 'vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService' +import { IPluginMarketplaceService } from 'vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service' +import { WorkspacePluginSettingsService } from 'vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService' +import { IWorkspacePluginSettingsService } from 'vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.service' +import { ICustomizationMigrationService } from 'vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.service' +import { SessionChatPillVisibility } from 'vs/workbench/contrib/chat/common/sessionChatPills' +import { ISessionChatPillVisibilityService } from 'vs/workbench/contrib/chat/common/sessionChatPills.service' +import { ChatArtifactsService } from 'vs/workbench/contrib/chat/common/tools/chatArtifactsService' +import { IChatArtifactsService } from 'vs/workbench/contrib/chat/common/tools/chatArtifactsService.service' import { ChatTodoListService } from 'vs/workbench/contrib/chat/common/tools/chatTodoListService' +import { IChatTodoListService } from 'vs/workbench/contrib/chat/common/tools/chatTodoListService.service' +import { ILanguageModelToolsConfirmationService } from 'vs/workbench/contrib/chat/common/tools/languageModelToolsConfirmationService.service' +import { ILanguageModelToolsService } from 'vs/workbench/contrib/chat/common/tools/languageModelToolsService.service' +import { IToolResultCompressor } from 'vs/workbench/contrib/chat/common/tools/toolResultCompressor.service' +import { IVoiceClientService } from 'vs/workbench/contrib/chat/common/voiceClient/voiceClientService.service' +import { VoicePlaybackService } from 'vs/workbench/contrib/chat/common/voicePlaybackService' +import { IVoicePlaybackService } from 'vs/workbench/contrib/chat/common/voicePlaybackService.service' import { IChatLayoutService } from 'vs/workbench/contrib/chat/common/widget/chatLayoutService.service' -import { ChatLayoutService } from 'vs/workbench/contrib/chat/browser/widget/chatLayoutService' +import { ChatResponseResourceFileSystemProvider } from 'vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider' +import { IChatResponseResourceFileSystemProvider } from 'vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.service' +import { ChatWidgetHistoryService } from 'vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService' +import { IChatWidgetHistoryService } from 'vs/workbench/contrib/chat/common/widget/chatWidgetHistoryService.service' import { IAiEditTelemetryService } from 'vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryService.service' import { AiEditTelemetryServiceImpl } from 'vs/workbench/contrib/editTelemetry/browser/telemetry/aiEditTelemetry/aiEditTelemetryServiceImpl' -import { IChatModeService } from 'vs/workbench/contrib/chat/common/chatModes.service' -import { ChatModeService } from 'vs/workbench/contrib/chat/common/chatModes' -import { ILanguageModelToolsConfirmationService } from 'vs/workbench/contrib/chat/common/tools/languageModelToolsConfirmationService.service' -import { LanguageModelToolsConfirmationService } from 'vs/workbench/contrib/chat/browser/tools/languageModelToolsConfirmationService' -import { IChatContextService } from 'vs/workbench/contrib/chat/browser/contextContrib/chatContextService.service' -import { ChatContextService } from 'vs/workbench/contrib/chat/browser/contextContrib/chatContextService' +import { RemoteCodingAgentsService } from 'vs/workbench/contrib/remoteCodingAgents/common/remoteCodingAgentsService' +import { IRemoteCodingAgentsService } from 'vs/workbench/contrib/remoteCodingAgents/common/remoteCodingAgentsService.service' +import { AgentHostTerminalService } from 'vs/workbench/contrib/terminal/browser/agentHostTerminalService' +import { IAgentHostTerminalService } from 'vs/workbench/contrib/terminal/browser/agentHostTerminalService.service' import { ITerminalChatService } from 'vs/workbench/contrib/terminal/browser/terminal.service' import { TerminalChatService } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChatService' -import { ChatStatusItemService } from 'vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService' -import { IChatStatusItemService } from 'vs/workbench/contrib/chat/browser/chatStatus/chatStatusItemService.service' -import { IAgentSessionsService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService.service' -import { AgentSessionsService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentSessionsService' -import { ChatWidgetService } from 'vs/workbench/contrib/chat/browser/widget/chatWidgetService' -import { ICodeCompareModelService } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart.service' -import { CodeCompareModelService } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatTextEditContentPart' -import { IAgentSessionProjectionService } from 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService.service' -import { IAgentTitleBarStatusService } from 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusService.service' -import { ILanguageModelsConfigurationService } from 'vs/workbench/contrib/chat/common/languageModelsConfiguration.service' -import { IChatTipService } from 'vs/workbench/contrib/chat/browser/chatTipService.service' -import { IChatEditingExplanationModelManager } from 'vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager.service' -import { IChatOutputPartStateCache } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatOutputPartStateCache.service' -import { AgentSessionProjectionService } from 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionProjectionService' -import { AgentTitleBarStatusService } from 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentTitleBarStatusService' -import { LanguageModelsConfigurationService } from 'vs/workbench/contrib/chat/browser/languageModelsConfigurationService' -import { ChatTipService } from 'vs/workbench/contrib/chat/browser/chatTipService' -import { ChatEditingExplanationModelManager } from 'vs/workbench/contrib/chat/browser/chatEditing/chatEditingExplanationModelManager' -import { ChatOutputPartStateCache } from 'vs/workbench/contrib/chat/browser/widget/chatContentParts/chatOutputPartStateCache' +import { TerminalChatSessionResolver } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChatSessionResolver' +import { ITerminalChatSessionResolver } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChatSessionResolver.service' import { ITerminalSandboxService, TerminalSandboxService } from 'vs/workbench/contrib/terminalContrib/chatAgentTools/common/terminalSandboxService' -import { IAICustomizationWorkspaceService } from 'vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service' -import { IAgentPluginService } from 'vs/workbench/contrib/chat/common/plugins/agentPluginService.service' -import { AgentPluginService } from 'vs/workbench/contrib/chat/common/plugins/agentPluginServiceImpl' -import { PluginMarketplaceService } from 'vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService' -import { IPluginMarketplaceService } from 'vs/workbench/contrib/chat/common/plugins/pluginMarketplaceService.service' -import { IAgentPluginRepositoryService } from 'vs/workbench/contrib/chat/common/plugins/agentPluginRepositoryService.service' -import { AgentPluginRepositoryService } from 'vs/workbench/contrib/chat/browser/agentPluginRepositoryService' -import { IPluginInstallService } from 'vs/workbench/contrib/chat/common/plugins/pluginInstallService.service' -import { PluginInstallService } from 'vs/workbench/contrib/chat/browser/pluginInstallService' -import { IChatAttachmentWidgetRegistry } from 'vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry.service' -import { ChatAttachmentWidgetRegistry } from 'vs/workbench/contrib/chat/browser/attachments/chatAttachmentWidgetRegistry' -import { IChatDebugService } from 'vs/workbench/contrib/chat/common/chatDebugService.service' -import { ChatDebugServiceImpl } from 'vs/workbench/contrib/chat/common/chatDebugServiceImpl' -import { IChatResponseResourceFileSystemProvider } from 'vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider.service' -import { ChatResponseResourceFileSystemProvider } from 'vs/workbench/contrib/chat/common/widget/chatResponseResourceFileSystemProvider' -import { Event } from 'vs/base/common/event' -import type { IDefaultAccount } from 'vs/base/common/defaultAccount' -import { IDefaultAccountService } from 'vs/platform/defaultAccount/common/defaultAccount.service' -import { MANAGED_SETTINGS_FRESHNESS_NOT_REQUIRED } from 'vs/platform/defaultAccount/common/defaultAccount' -import { ICustomizationHarnessService } from 'vs/workbench/contrib/chat/common/customizationHarnessService.service' -import { CustomizationHarnessService } from 'vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService' -import { AICustomizationWorkspaceService } from 'vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService' -import { IChatArtifactsService } from 'vs/workbench/contrib/chat/common/tools/chatArtifactsService.service' -import { ChatArtifactsService } from 'vs/workbench/contrib/chat/common/tools/chatArtifactsService' -import { IWorkspacePluginSettingsService } from 'vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService.service' -import { WorkspacePluginSettingsService } from 'vs/workbench/contrib/chat/common/plugins/workspacePluginSettingsService' -import { IChatImageCarouselService } from 'vs/workbench/contrib/chat/browser/chatImageCarouselService.service' -import { ChatImageCarouselService } from 'vs/workbench/contrib/chat/browser/chatImageCarouselService' -import { NullSandboxHelperService } from 'vs/platform/sandbox/browser/sandboxHelperService' -import { ISandboxHelperService } from 'vs/platform/sandbox/common/sandboxHelperService.service' -import { IPluginGitService } from 'vs/workbench/contrib/chat/common/plugins/pluginGitService.service' -import { BrowserPluginGitCommandService } from 'vs/workbench/contrib/chat/browser/pluginGitCommandService' -import { IAgentNetworkFilterService } from 'vs/platform/networkFilter/common/networkFilterService.service' -import { AgentNetworkFilterService } from 'vs/platform/networkFilter/common/networkFilterService' -import { IAgentHostFileSystemService } from 'vs/workbench/services/agentHost/common/agentHostFileSystemService.service' -import { IAgentHostSessionWorkingDirectoryResolver } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver.service' -import { IAgentHostNewSessionFolderService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService.service' -import { IAgentHostToolSetEnablementService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService.service' -import { IAgentHostTerminalService } from 'vs/workbench/contrib/terminal/browser/agentHostTerminalService.service' -import { AgentHostTerminalService } from 'vs/workbench/contrib/terminal/browser/agentHostTerminalService' -import { IRemoteAgentHostService } from 'vs/platform/agentHost/common/remoteAgentHostService.service' -import { RemoteAgentHostService } from 'vs/platform/agentHost/browser/remoteAgentHostServiceImpl' -import { AgentHostFileSystemService } from 'vs/workbench/services/agentHost/common/agentHostFileSystemService' -import { AgentHostSessionWorkingDirectoryResolver } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectoryResolver' -import { AgentHostNewSessionFolderService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostNewSessionFolderService' -import { AgentHostToolSetEnablementService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostToolSetEnablementService' -import { IAgentHostResourceService } from 'vs/platform/agentHost/common/agentHostResourceService.service' -import { IToolResultCompressor } from 'vs/workbench/contrib/chat/common/tools/toolResultCompressor.service' -import { IChatToolRiskAssessmentService } from 'vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService.service' -import { IPlanReviewFeedbackService } from 'vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService.service' -import { IChatInputNotificationService } from 'vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService.service' -import { IChatPhoneInputPresenter } from 'vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter.service' -import { ChatToolRiskAssessmentService } from 'vs/workbench/contrib/chat/browser/tools/chatToolRiskAssessmentService' -import { PlanReviewFeedbackService } from 'vs/workbench/contrib/chat/browser/planReviewFeedback/planReviewFeedbackService' -import { AgentHostResourceService } from 'vs/workbench/services/agentHost/common/agentHostResourceService' -import { ToolResultCompressorService } from 'vs/workbench/contrib/chat/browser/tools/toolResultCompressorService' -import { ChatInputNotificationService } from 'vs/workbench/contrib/chat/browser/widget/input/chatInputNotificationService' -import { ChatPhoneInputPresenterService } from 'vs/workbench/contrib/chat/browser/widget/input/chatPhoneInputPresenter' -import { IAgentHostUntitledProvisionalSessionService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService.service' -import { IAgentHostDebugLogsExportService } from 'vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction.service' -import { AgentHostUntitledProvisionalSessionService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostUntitledProvisionalSessionService' -import { BrowserAgentHostDebugLogsExportService } from 'vs/workbench/contrib/chat/browser/actions/exportAgentHostDebugLogsAction' -import { IAgentHostActiveClientService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service' -import { AgentHostActiveClientService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService' -import { IAgentHostCustomizationService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.service' -import { NullAgentHostCustomizationService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService' -import { IChatGoalSummaryService } from 'vs/workbench/contrib/chat/browser/chatGoalSummaryService.service' -import { ChatGoalSummaryService } from 'vs/workbench/contrib/chat/browser/chatGoalSummaryService' -import { IAgentHostImportConversationStore } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostImportConversationStore.service' -import { AgentHostImportConversationStore } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostImportConversationStore' -import { IAgentHostProtectedResourcesService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService.service' -import { AgentHostProtectedResourcesService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostProtectedResourcesService' -import { IAgentHostSessionWorkingDirectorySynchronizer } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer.service' -import { AgentHostSessionWorkingDirectorySynchronizer } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSessionWorkingDirectorySynchronizer' -import { IAgentHostShellInitSynchronizer } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer.service' -import { AgentHostShellInitSynchronizer } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostShellInitSynchronizer' +import { AgentSdkSetupService } from 'vs/workbench/services/agentHost/browser/agentSdkSetupService' import { IAgentSdkSetupService } from 'vs/workbench/services/agentHost/browser/agentSdkSetupService.service' -import { ICodexAccountService } from 'vs/workbench/services/agentHost/browser/codexAccountService.service' import { CodexAccountService } from 'vs/workbench/services/agentHost/browser/codexAccountService' -import { IChatInputNoticeHubService } from 'vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub.service' -import { IChatModelFeedbackSurveyService } from 'vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyService.service' -import { ChatModelFeedbackSurveyService } from 'vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyService' -import { IChatPasteTargetService } from 'vs/workbench/contrib/chat/browser/chat.service' -import { ChatPasteTargetService } from 'vs/workbench/contrib/chat/browser/attachments/chatPasteTargetService' -import { IChatPetService } from 'vs/workbench/contrib/chat/browser/chatPetService.service' -import { ChatPetService } from 'vs/workbench/contrib/chat/browser/chatPetService' -import { IChatPetWidgetService } from 'vs/workbench/contrib/chat/browser/widget/chatPetWidgetService.service' -import { ChatPetWidgetService } from 'vs/workbench/contrib/chat/browser/widget/chatPetWidgetService' -import { IChatRequestOriginService } from 'vs/workbench/contrib/chat/common/chatRequestOrigin.service' -import { ChatRequestOriginService } from 'vs/workbench/contrib/chat/common/chatRequestOrigin' -import { IChatSideChatService } from 'vs/workbench/contrib/chat/common/chatSideChatService.service' -import { ChatSideChatService } from 'vs/workbench/contrib/chat/common/chatSideChatService' -import { IChatSpeechToTextService } from 'vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService.service' -import { ChatSpeechToTextService } from 'vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService' -import { IChatSubmitRequestHandlerService } from 'vs/workbench/contrib/chat/browser/chatSubmitRequestHandlerService.service' -import { ChatSubmitRequestHandlerService } from 'vs/workbench/contrib/chat/browser/chatSubmitRequestHandlerService' -import { ICustomizationMigrationService } from 'vs/workbench/contrib/chat/common/promptSyntax/service/customizationMigrationService.service' -import { CustomizationMigrationService } from 'vs/workbench/contrib/chat/browser/aiCustomization/customizationMigrationServiceImpl' -import { IDictationOnboardingService } from 'vs/workbench/contrib/chat/browser/speechToText/dictationOnboarding.service' -import { DictationOnboardingService } from 'vs/workbench/contrib/chat/browser/speechToText/dictationOnboarding' -import { IInlineChatSessionResolver } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSessionResolver.service' -import { InlineChatSessionResolver } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSessionResolver' -import { ISessionChatPillVisibilityService } from 'vs/workbench/contrib/chat/common/sessionChatPills.service' -import { SessionChatPillVisibility } from 'vs/workbench/contrib/chat/common/sessionChatPills' -import { ISessionSummaryHoverService } from 'vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService.service' -import { SessionSummaryHoverService } from 'vs/workbench/contrib/chat/browser/agentSessions/sessionSummaryHoverService' -import { ITerminalChatSessionResolver } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChatSessionResolver.service' -import { TerminalChatSessionResolver } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChatSessionResolver' -import { IVoiceCodeTranscriptionClient } from 'vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.service' -import { VoiceCodeTranscriptionClient } from 'vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient' -import { IVoiceInputModeService } from 'vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode.service' -import { VoiceInputModeService } from 'vs/workbench/contrib/chat/browser/voiceInputMode/voiceInputMode' -import { IVoiceModeOnboardingService } from 'vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding.service' -import { VoiceModeOnboardingService } from 'vs/workbench/contrib/agentsVoice/browser/voiceModeOnboarding' +import { ICodexAccountService } from 'vs/workbench/services/agentHost/browser/codexAccountService.service' import { EditorRemoteAgentHostServiceClient } from 'vs/workbench/services/agentHost/browser/editorRemoteAgentHostServiceClient' import { WebAgentHostEnablementService } from 'vs/workbench/services/agentHost/browser/webAgentHostEnablementService' -import { IAgentHostService } from 'vs/platform/agentHost/common/agentService.service' -import { IAgentHostConnectionsService } from 'vs/platform/agentHost/common/agentHostConnectionsService.service' -import { IAgentHostEnablementService } from 'vs/platform/agentHost/common/agentHostEnablementService.service' -import { AgentHostConnectionsService } from 'vs/platform/agentHost/browser/agentHostConnectionsService' -import { IChatResponseFileChangesService } from 'vs/workbench/contrib/chat/browser/chatResponseFileChangesService.service' -import { EditorChatResponseFileChangesService } from 'vs/workbench/contrib/chat/browser/editorChatResponseFileChangesService' -import { IMicCaptureService } from 'vs/workbench/contrib/chat/browser/voiceClient/micCaptureService.service' -import { MicCaptureService } from 'vs/workbench/contrib/chat/browser/voiceClient/micCaptureService' -import { ITtsPlaybackService } from 'vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService.service' -import { TtsPlaybackService } from 'vs/workbench/contrib/chat/browser/voiceClient/ttsPlaybackService' -import { IVoiceClientService } from 'vs/workbench/contrib/chat/common/voiceClient/voiceClientService.service' -import { VoiceClientService } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceClientService' -import { IVoiceSessionController } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController.service' -import { VoiceSessionController } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceSessionController' -import { IVoiceToolDispatchService } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService.service' -import { VoiceToolDispatchService } from 'vs/workbench/contrib/chat/browser/voiceClient/voiceToolDispatchService' -import { IVoicePlaybackService } from 'vs/workbench/contrib/chat/common/voicePlaybackService.service' -import { VoicePlaybackService } from 'vs/workbench/contrib/chat/common/voicePlaybackService' -import { IVoiceTranscriptStore } from 'vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore.service' -import { VoiceTranscriptStore } from 'vs/workbench/contrib/agentsVoice/common/voiceTranscriptStore' -import { IAgentsVoiceWindowService } from 'vs/workbench/contrib/agentsVoice/common/agentsVoice.service' -import { AgentsVoiceWindowService } from 'vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService' -import { ILinkPresentationService } from 'vs/platform/dataChannel/common/dataChannel.service' -export type { ITelemetryData, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry' +import { AgentHostFileSystemService } from 'vs/workbench/services/agentHost/common/agentHostFileSystemService' +import { IAgentHostFileSystemService } from 'vs/workbench/services/agentHost/common/agentHostFileSystemService.service' +import { AgentHostResourceService } from 'vs/workbench/services/agentHost/common/agentHostResourceService' +import { + ChatEntitlement, + ChatEntitlementService, + type IChatEntitlementContextState +} from 'vs/workbench/services/chat/common/chatEntitlementService' +import { IChatEntitlementService } from 'vs/workbench/services/chat/common/chatEntitlementService.service' import { LinkPresentationService } from 'vs/workbench/services/dataChannel/browser/dataChannelService' -import { AgentSdkSetupService } from 'vs/workbench/services/agentHost/browser/agentSdkSetupService' -import { ChatInputNoticeHubService } from 'vs/workbench/contrib/chat/browser/widget/input/chatInputNoticeHub' -import 'vs/workbench/contrib/chat/browser/chat.contribution' -import 'vs/workbench/contrib/chat/browser/chat.shared.contribution' -import 'vs/workbench/contrib/chat/browser/chat.view.contribution' -import 'vs/workbench/contrib/terminal/terminal.chat.contribution' -import 'vs/workbench/contrib/inlineChat/browser/inlineChat.contribution' -import 'vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution' -import 'vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution' -import 'vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution' -import 'vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution' - -import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution' -import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution' -import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution' -import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution' -import 'vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution' +import { AgentHostByokLmHandler } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostByokLmHandler' +import { IAgentHostByokLmHandler } from 'vs/platform/agentHost/common/agentHostByokLm.service' import 'vs/platform/agentHost/common/agentHostStarter.config.contribution' +import 'vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution' +import 'vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution' +import 'vs/workbench/contrib/remoteCodingAgents/browser/remoteCodingAgents.contribution' +import 'vs/workbench/contrib/terminal/terminal.chat.contribution' import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostChatInputPicker.contribution' -import 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution' +import 'vs/workbench/contrib/chat/browser/agentSessions/agentSessions.contribution' import 'vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationManagement.contribution' +import 'vs/workbench/contrib/chat/browser/contextContrib/chatContext.contribution' import 'vs/workbench/contrib/chat/browser/attachments/chatReferenceAttachmentWidget.contribution' import 'vs/workbench/contrib/chat/browser/attachments/transcriptContextAttachmentWidget.contribution' import 'vs/workbench/api/browser/extensionHost.chat.contribution' +import 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution' -class DefaultAccountService implements IDefaultAccountService { - declare _serviceBrand: undefined - constructor(private defaultAccount: IDefaultAccount | null) {} - - resolveGitHubUrl: IDefaultAccountService['resolveGitHubUrl'] = (path) => path - currentDefaultAccount: IDefaultAccountService['currentDefaultAccount'] = null - - onDidChangePolicyData: IDefaultAccountService['onDidChangePolicyData'] = Event.None - policyData: IDefaultAccountService['policyData'] = null - managedSettingsFetchStatus: IDefaultAccountService['managedSettingsFetchStatus'] = null - managedSettingsFetchedAt: IDefaultAccountService['managedSettingsFetchedAt'] = null - managedSettingsRawResponse: IDefaultAccountService['managedSettingsRawResponse'] = undefined - managedSettingsCompatibilityError: IDefaultAccountService['managedSettingsCompatibilityError'] = - null - onDidChangeManagedSettingsCompatibilityError: IDefaultAccountService['onDidChangeManagedSettingsCompatibilityError'] = - Event.None - managedSettingsFreshness: IDefaultAccountService['managedSettingsFreshness'] = - MANAGED_SETTINGS_FRESHNESS_NOT_REQUIRED - onDidChangeManagedSettingsFreshness: IDefaultAccountService['onDidChangeManagedSettingsFreshness'] = - Event.None - - getDefaultAccountAuthenticationProvider: IDefaultAccountService['getDefaultAccountAuthenticationProvider'] = - () => ({ id: 'default', name: 'Default', enterprise: false }) - setDefaultAccountProvider: IDefaultAccountService['setDefaultAccountProvider'] = () => {} - refresh: IDefaultAccountService['refresh'] = async () => null - signIn: IDefaultAccountService['signIn'] = async () => null - - readonly onDidChangeDefaultAccount: IDefaultAccountService['onDidChangeDefaultAccount'] = - Event.None - - getDefaultAccount: IDefaultAccountService['getDefaultAccount'] = async () => this.defaultAccount - - copilotTokenInfo: IDefaultAccountService['copilotTokenInfo'] = null - onDidChangeCopilotTokenInfo: IDefaultAccountService['onDidChangeCopilotTokenInfo'] = Event.None - signOut: IDefaultAccountService['signOut'] = async () => {} -} - -export interface ChatServiceOverrideOptions { - defaultAccount?: IDefaultAccount -} - -export default function getServiceOverride({ - defaultAccount -}: ChatServiceOverrideOptions = {}): IEditorOverrideServices { +export default function getServiceOverride(): IEditorOverrideServices { return { [IChatService.toString()]: new SyncDescriptor(ChatService, [], true), [IChatWidgetService.toString()]: new SyncDescriptor(ChatWidgetService, [], true), @@ -318,11 +249,6 @@ export default function getServiceOverride({ [IChatSlashCommandService.toString()]: new SyncDescriptor(ChatSlashCommandService, [], true), [IChatAgentService.toString()]: new SyncDescriptor(ChatAgentService, [], true), [IChatVariablesService.toString()]: new SyncDescriptor(ChatVariablesService, [], true), - [IInlineChatSessionService.toString()]: new SyncDescriptor( - InlineChatSessionServiceImpl, - [], - true - ), [IChatCodeBlockContextProviderService.toString()]: new SyncDescriptor( ChatCodeBlockContextProviderService, [], @@ -353,7 +279,6 @@ export default function getServiceOverride({ true ), [IChatEntitlementService.toString()]: new SyncDescriptor(ChatEntitlementService, [], true), - [IPromptsService.toString()]: new SyncDescriptor(PromptsService, [], true), [IChatStatusItemService.toString()]: new SyncDescriptor(ChatStatusItemService, [], true), [IChatContextPickService.toString()]: new SyncDescriptor(ChatContextPickService, [], true), [IChatAttachmentResolveService.toString()]: new SyncDescriptor( @@ -409,11 +334,6 @@ export default function getServiceOverride({ [IChatOutputPartStateCache.toString()]: new SyncDescriptor(ChatOutputPartStateCache, [], true), [ITerminalSandboxService.toString()]: new SyncDescriptor(TerminalSandboxService, [], true), [ISandboxHelperService.toString()]: new SyncDescriptor(NullSandboxHelperService, [], true), - [IAICustomizationWorkspaceService.toString()]: new SyncDescriptor( - AICustomizationWorkspaceService, - [], - true - ), [IAgentPluginService.toString()]: new SyncDescriptor(AgentPluginService, [], true), [IPluginMarketplaceService.toString()]: new SyncDescriptor(PluginMarketplaceService, [], true), [IAgentPluginRepositoryService.toString()]: new SyncDescriptor( @@ -433,16 +353,6 @@ export default function getServiceOverride({ [], true ), - [IDefaultAccountService.toString()]: new SyncDescriptor( - DefaultAccountService, - [defaultAccount], - true - ), - [ICustomizationHarnessService.toString()]: new SyncDescriptor( - CustomizationHarnessService, - [], - true - ), [IChatArtifactsService.toString()]: new SyncDescriptor(ChatArtifactsService, [], true), [IWorkspacePluginSettingsService.toString()]: new SyncDescriptor( WorkspacePluginSettingsService, @@ -456,7 +366,6 @@ export default function getServiceOverride({ [], true ), - [IRemoteAgentHostService.toString()]: new SyncDescriptor(RemoteAgentHostService, [], true), [IAgentHostFileSystemService.toString()]: new SyncDescriptor( AgentHostFileSystemService, [], @@ -490,17 +399,11 @@ export default function getServiceOverride({ [IVoiceToolDispatchService.toString()]: new SyncDescriptor(VoiceToolDispatchService, [], true), [IVoicePlaybackService.toString()]: new SyncDescriptor(VoicePlaybackService, [], true), [IVoiceTranscriptStore.toString()]: new SyncDescriptor(VoiceTranscriptStore, [], true), - [IAgentsVoiceWindowService.toString()]: new SyncDescriptor(AgentsVoiceWindowService, [], true), [IAgentHostActiveClientService.toString()]: new SyncDescriptor( AgentHostActiveClientService, [], true ), - [IAgentHostCustomizationService.toString()]: new SyncDescriptor( - NullAgentHostCustomizationService, - [], - true - ), [IToolResultCompressor.toString()]: new SyncDescriptor(ToolResultCompressorService, [], true), [IChatGoalSummaryService.toString()]: new SyncDescriptor(ChatGoalSummaryService, [], true), [IChatResponseFileChangesService.toString()]: new SyncDescriptor( @@ -592,11 +495,6 @@ export default function getServiceOverride({ [], true ), - [IInlineChatSessionResolver.toString()]: new SyncDescriptor( - InlineChatSessionResolver, - [], - true - ), [ISessionChatPillVisibilityService.toString()]: new SyncDescriptor( SessionChatPillVisibility, [], @@ -633,8 +531,10 @@ export default function getServiceOverride({ [], true ), - [ILinkPresentationService.toString()]: new SyncDescriptor(LinkPresentationService, [], true) + [ILinkPresentationService.toString()]: new SyncDescriptor(LinkPresentationService, [], true), + [IAgentHostByokLmHandler.toString()]: new SyncDescriptor(AgentHostByokLmHandler, [], true) } } -export { type IDefaultAccount, ChatEntitlement, type IChatEntitlementContextState } +export type { ITelemetryData, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry' +export { ChatEntitlement, type IChatEntitlementContextState, type IDefaultAccount } diff --git a/src/service-override/chat/session.ts b/src/service-override/chat/session.ts new file mode 100644 index 00000000..c947bb46 --- /dev/null +++ b/src/service-override/chat/session.ts @@ -0,0 +1,82 @@ +import type { IDefaultAccount } from 'vs/base/common/defaultAccount' +import { type IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { AgentsWindowRemoteAgentHostService } from 'vs/platform/agentHost/browser/remoteAgentHostServiceImpl' +import { IRemoteAgentHostService } from 'vs/platform/agentHost/common/remoteAgentHostService.service' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { IAgentHostCustomizationService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.service' +import { IAICustomizationWorkspaceService } from 'vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service' +import { ICustomizationHarnessService } from 'vs/workbench/contrib/chat/common/customizationHarnessService.service' +import { IPromptsService } from 'vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service' +import { IInlineChatSessionService } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service' +import { + ChatEntitlement, + type IChatEntitlementContextState +} from 'vs/workbench/services/chat/common/chatEntitlementService' +export type { ITelemetryData, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry' +import { SessionsAICustomizationWorkspaceService } from 'vs/sessions/contrib/chat/browser/aiCustomizationWorkspaceService' +import { SessionsCustomizationHarnessService } from 'vs/sessions/contrib/chat/browser/customizationHarnessService' +import { NullInlineChatSessionService } from 'vs/sessions/contrib/chat/browser/nullInlineChatSessionService' +import { AgenticPromptsService } from 'vs/sessions/contrib/chat/browser/promptsService' +import { AgentHostCustomizationService } from 'vs/sessions/services/agentHost/browser/agentHostCustomizationService' +import getCommonServiceOverride from './common.js' +import { IChatResponseFileChangesService } from 'vs/workbench/contrib/chat/browser/chatResponseFileChangesService.service.js' +import { SessionsChatResponseFileChangesService } from 'vs/sessions/contrib/chat/browser/sessionTurnChanges.js' + +import 'vs/sessions/contrib/chat/browser/btwSlashCommand.contribution' +import 'vs/sessions/contrib/chat/browser/chat.contribution' +import 'vs/sessions/contrib/chat/browser/customizationsDebugLog.contribution' +import 'vs/sessions/contrib/chat/browser/openSessionLinkOpener.contribution' +import 'vs/sessions/contrib/chat/browser/requestOriginProvider.contribution' +import 'vs/sessions/contrib/chat/browser/sideChatProvider.contribution' +import 'vs/sessions/contrib/chat/browser/voiceBridge.contribution' +import 'vs/sessions/contrib/providers/agentHost/browser/agentHostSettings.contribution' +import 'vs/sessions/contrib/providers/agentHost/browser/agentSessionSettings.contribution' +import 'vs/sessions/contrib/providers/copilotChatSessions/browser/copilotChatSessions.contribution' +import 'vs/sessions/contrib/providers/copilotChatSessions/browser/mobilePermissionPicker.contribution' +import 'vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHost.contribution' +import 'vs/sessions/contrib/providers/remoteAgentHost/browser/hostFilter.contribution' +import 'vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHost.contribution' +import 'vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostTerminal.contribution' +import 'vs/sessions/contrib/providers/remoteAgentHost/browser/tunnelAgentHost.contribution' +import 'vs/sessions/contrib/providers/remoteAgentHost/browser/webSocketAgentHost.contribution' +import 'vs/sessions/contrib/providers/remoteAgentHost/browser/webTunnelAgentHostService.contribution' +import 'vs/sessions/contrib/providers/remoteAgentHost/browser/wslAgentHost.contribution' + +export default function getServiceOverride(): IEditorOverrideServices { + return { + ...getCommonServiceOverride(), + [IInlineChatSessionService.toString()]: new SyncDescriptor( + NullInlineChatSessionService, + [], + true + ), + [IPromptsService.toString()]: new SyncDescriptor(AgenticPromptsService, [], true), + [IAICustomizationWorkspaceService.toString()]: new SyncDescriptor( + SessionsAICustomizationWorkspaceService, + [], + true + ), + [ICustomizationHarnessService.toString()]: new SyncDescriptor( + SessionsCustomizationHarnessService, + [], + true + ), + [IRemoteAgentHostService.toString()]: new SyncDescriptor( + AgentsWindowRemoteAgentHostService, + [], + true + ), + [IAgentHostCustomizationService.toString()]: new SyncDescriptor( + AgentHostCustomizationService, + [], + true + ), + [IChatResponseFileChangesService.toString()]: new SyncDescriptor( + SessionsChatResponseFileChangesService, + [], + true + ) + } +} + +export { ChatEntitlement, type IChatEntitlementContextState, type IDefaultAccount } diff --git a/src/service-override/configuration.ts b/src/service-override/configuration/classic.ts similarity index 97% rename from src/service-override/configuration.ts rename to src/service-override/configuration/classic.ts index 39f78ba6..cd1da81c 100644 --- a/src/service-override/configuration.ts +++ b/src/service-override/configuration/classic.ts @@ -56,11 +56,11 @@ import { BrowserWorkspacesService } from 'vs/workbench/services/workspaces/brows import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing.service' import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/browser/configurationResolverService' import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver.service' -import getFileServiceOverride, { initFile } from './files' -import { registerServiceInitializePreParticipant } from '../lifecycle' -import { getService, withReadyServices } from '../services' -import { memoizedConstructor, unsupported } from '../tools' -import { getWorkbenchConstructionOptions, getWorkspaceIdentifier } from '../workbench' +import getFileServiceOverride, { initFile } from '../files' +import { registerServiceInitializePreParticipant } from '../../lifecycle' +import { getService, withReadyServices } from '../../services' +import { memoizedConstructor, unsupported } from '../../tools' +import { getWorkbenchConstructionOptions, getWorkspaceIdentifier } from '../../workbench' // This is the default value, but can be overriden by overriding the Environment or UserDataProfileService service const defaultUserConfigurationFile = URI.from({ diff --git a/src/service-override/configuration/session.ts b/src/service-override/configuration/session.ts new file mode 100644 index 00000000..1ae7baf1 --- /dev/null +++ b/src/service-override/configuration/session.ts @@ -0,0 +1,218 @@ +import { VSBuffer } from 'vs/base/common/buffer' +import type { IDisposable } from 'vs/base/common/lifecycle' +import { Schemas } from 'vs/base/common/network' +import { URI } from 'vs/base/common/uri' +import { + ITextResourceConfigurationService, + ITextResourcePropertiesService +} from 'vs/editor/common/services/textResourceConfiguration.service' +import { TextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService' +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { IConfigurationService } from 'vs/platform/configuration/common/configuration.service' +import { + Extensions as ConfigurationExtensions, + ConfigurationScope, + type IConfigurationDefaults, + type IConfigurationNode, + type IConfigurationRegistry +} from 'vs/platform/configuration/common/configurationRegistry' +import type { IFileWriteOptions } from 'vs/platform/files/common/files' +import { IFileService } from 'vs/platform/files/common/files.service' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { IPolicyService } from 'vs/platform/policy/common/policy.service' +import { Registry } from 'vs/platform/registry/common/platform' +import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity.service' +import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile.service' +import { + isWorkspaceIdentifier, + type IAnyWorkspaceIdentifier, + type IEmptyWorkspaceIdentifier, + type ISingleFolderWorkspaceIdentifier, + type IWorkspaceIdentifier +} from 'vs/platform/workspace/common/workspace' +import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace.service' +import type { + IStoredWorkspace, + IWorkspaceFolderCreationData +} from 'vs/platform/workspaces/common/workspaces' +import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces.service' +import 'vs/workbench/api/common/configurationExtensionPoint' +import 'vs/workbench/contrib/workspaces/browser/workspaces.contribution' +import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService.service' +import { TextResourcePropertiesService } from 'vs/workbench/services/textresourceProperties/common/textResourcePropertiesService' +import type { + IColorCustomizations, + IThemeScopedColorCustomizations +} from 'vs/workbench/services/themes/common/workbenchThemeService' +import { BrowserWorkspacesService } from 'vs/workbench/services/workspaces/browser/workspacesService' +import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing.service' +import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/browser/configurationResolverService' +import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver.service' +import getFileServiceOverride, { initFile } from '../files' +import { getService, withReadyServices } from '../../services' +import { memoizedConstructor } from '../../tools' +import { SessionsWorkspaceContextService } from 'vs/sessions/services/workspace/browser/workspaceContextService' +import { getWorkspaceIdentifier } from '../../workbench' +import { ILogService } from 'vs/platform/log/common/log.service' +import { ConfigurationService } from 'vs/sessions/services/configuration/browser/configurationService' +import { ConfigurationCache } from 'vs/workbench/services/configuration/common/configurationCache' +import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile.service' +import 'vs/sessions/contrib/configuration/browser/configuration.contribution' + +// This is the default value, but can be overriden by overriding the Environment or UserDataProfileService service +const defaultUserConfigurationFile = URI.from({ + scheme: Schemas.vscodeUserData, + path: '/User/settings.json' +}) + +/** + * Should be called only BEFORE the service are initialized to initialize the file on the filesystem before the configuration service initializes + */ +async function initUserConfiguration( + configurationJson: string, + options?: Partial, + file: URI = defaultUserConfigurationFile +): Promise { + await initFile(file, configurationJson, options) +} + +/** + * Can be called at any time after the services are initialized to update the user configuration + */ +async function updateUserConfiguration(configurationJson: string): Promise { + const userDataProfilesService = await getService(IUserDataProfilesService) + const fileService = await getService(IFileService) + await fileService.writeFile( + userDataProfilesService.defaultProfile.settingsResource, + VSBuffer.fromString(configurationJson) + ) +} + +async function getUserConfiguration(): Promise { + const userDataProfilesService = await getService(IUserDataProfilesService) + const fileService = await getService(IFileService) + return ( + await fileService.readFile(userDataProfilesService.defaultProfile.settingsResource) + ).value.toString() +} + +function onUserConfigurationChange(callback: () => void): IDisposable { + return withReadyServices((accessor) => { + const userDataProfilesService = accessor.get(IUserDataProfilesService) + return accessor.get(IFileService).onDidFilesChange((e) => { + if (e.affects(userDataProfilesService.defaultProfile.settingsResource)) { + callback() + } + }) + }) +} + +const configurationRegistry = Registry.as( + ConfigurationExtensions.Configuration +) + +class InjectedSessionsWorkspaceContextService extends SessionsWorkspaceContextService { + constructor( + @IBrowserWorkbenchEnvironmentService environmentService: IBrowserWorkbenchEnvironmentService, + @IUriIdentityService uriIdentityService: IUriIdentityService + ) { + const workspaceIdentifier = getWorkspaceIdentifier() + if (!isWorkspaceIdentifier(workspaceIdentifier)) { + throw new Error( + 'The session configuration can only be loaded from a workspace configuration file' + ) + } + + super(workspaceIdentifier, uriIdentityService) + } +} + +const MemoizedInjectedSessionsWorkspaceContextService = memoizedConstructor( + InjectedSessionsWorkspaceContextService +) + +class InjectedConfigurationService extends ConfigurationService { + constructor( + @IUserDataProfileService userDataProfileService: IUserDataProfileService, + @IWorkspaceContextService workspaceService: IWorkspaceContextService, + @IUriIdentityService uriIdentityService: IUriIdentityService, + @IFileService fileService: IFileService, + @IPolicyService policyService: IPolicyService, + @ILogService logService: ILogService, + @IBrowserWorkbenchEnvironmentService environmentService: IBrowserWorkbenchEnvironmentService + ) { + const configurationCache = new ConfigurationCache( + [Schemas.file, Schemas.vscodeUserData], + environmentService, + fileService + ) + super( + userDataProfileService, + workspaceService, + uriIdentityService, + fileService, + policyService, + logService, + configurationCache, + environmentService + ) + } +} + +function getServiceOverride(): IEditorOverrideServices { + return { + ...getFileServiceOverride(), + [IConfigurationService.toString()]: new SyncDescriptor(InjectedConfigurationService, [], true), + [IWorkspaceContextService.toString()]: new SyncDescriptor( + MemoizedInjectedSessionsWorkspaceContextService, + [], + true + ), + [IWorkspaceEditingService.toString()]: new SyncDescriptor( + MemoizedInjectedSessionsWorkspaceContextService, + [], + true + ), + [ITextResourceConfigurationService.toString()]: new SyncDescriptor( + TextResourceConfigurationService, + [], + true + ), + + [IWorkspacesService.toString()]: new SyncDescriptor(BrowserWorkspacesService, [], true), + [ITextResourcePropertiesService.toString()]: new SyncDescriptor( + TextResourcePropertiesService, + [], + true + ), + [IConfigurationResolverService.toString()]: new SyncDescriptor( + ConfigurationResolverService, + [], + true + ) + } +} + +export default getServiceOverride + +export { + ConfigurationScope, + configurationRegistry, + defaultUserConfigurationFile, + getUserConfiguration, + initUserConfiguration, + onUserConfigurationChange, + updateUserConfiguration +} +export type { + IAnyWorkspaceIdentifier, + IColorCustomizations, + IConfigurationDefaults, + IConfigurationNode, + IEmptyWorkspaceIdentifier, + ISingleFolderWorkspaceIdentifier, + IStoredWorkspace, + IThemeScopedColorCustomizations, + IWorkspaceFolderCreationData, + IWorkspaceIdentifier +} diff --git a/src/service-override/debug.ts b/src/service-override/debug/classic.ts similarity index 98% rename from src/service-override/debug.ts rename to src/service-override/debug/classic.ts index 452f6961..a0da9b08 100644 --- a/src/service-override/debug.ts +++ b/src/service-override/debug/classic.ts @@ -10,7 +10,7 @@ import { BrowserExtensionHostDebugService } from 'vs/workbench/contrib/debug/bro import { IDebugVisualizerService } from 'vs/workbench/contrib/debug/common/debugVisualizers.service' import { DebugVisualizerService } from 'vs/workbench/contrib/debug/common/debugVisualizers' // Debug assets should be registered BEFORE the contribution code runs -import './tools/debugAssets' +import '../tools/debugAssets' import 'vs/workbench/contrib/debug/browser/debug.contribution' // remove "Open 'launch.json'" button diff --git a/src/service-override/debug/session.ts b/src/service-override/debug/session.ts new file mode 100644 index 00000000..1e495f99 --- /dev/null +++ b/src/service-override/debug/session.ts @@ -0,0 +1,22 @@ +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { IExtensionHostDebugService } from 'vs/platform/debug/common/extensionHostDebug.service' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { BrowserExtensionHostDebugService } from 'vs/workbench/contrib/debug/browser/extensionHostDebugService' +import { IDebugService } from 'vs/workbench/contrib/debug/common/debug.service' +import { IDebugVisualizerService } from 'vs/workbench/contrib/debug/common/debugVisualizers.service' +import { + NullDebugService, + NullDebugVisualizerService +} from 'vs/workbench/contrib/debug/common/nullDebugService' + +export default function getServiceOverride(): IEditorOverrideServices { + return { + [IDebugService.toString()]: new SyncDescriptor(NullDebugService, [], true), + [IExtensionHostDebugService.toString()]: new SyncDescriptor( + BrowserExtensionHostDebugService, + [], + true + ), + [IDebugVisualizerService.toString()]: new SyncDescriptor(NullDebugVisualizerService, [], true) + } +} diff --git a/src/service-override/dialogs/classic.ts b/src/service-override/dialogs/classic.ts new file mode 100644 index 00000000..178c08df --- /dev/null +++ b/src/service-override/dialogs/classic.ts @@ -0,0 +1,2 @@ +export { default } from './common' +import 'vs/workbench/browser/parts/dialogs/dialog.web.contribution' diff --git a/src/service-override/dialogs.ts b/src/service-override/dialogs/common.ts similarity index 94% rename from src/service-override/dialogs.ts rename to src/service-override/dialogs/common.ts index 30335e0f..b8146d8d 100644 --- a/src/service-override/dialogs.ts +++ b/src/service-override/dialogs/common.ts @@ -5,7 +5,6 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { FileDialogService } from 'vs/workbench/services/dialogs/browser/fileDialogService' import type { IFileSystemProvider } from 'vs/platform/files/common/files' import { HTMLFileSystemProvider } from 'vs/platform/files/browser/htmlFileSystemProvider' -import 'vs/workbench/browser/parts/dialogs/dialog.web.contribution' function isHTMLFileSystemProvider( provider: IFileSystemProvider diff --git a/src/service-override/dialogs/session.ts b/src/service-override/dialogs/session.ts new file mode 100644 index 00000000..70038273 --- /dev/null +++ b/src/service-override/dialogs/session.ts @@ -0,0 +1,2 @@ +export { default } from './common' +import 'vs/sessions/browser/parts/dialogs/mobileDialog.web.contribution' diff --git a/src/service-override/editor/classic.ts b/src/service-override/editor/classic.ts new file mode 100644 index 00000000..ddb7d6e9 --- /dev/null +++ b/src/service-override/editor/classic.ts @@ -0,0 +1,22 @@ +import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service.js' +import getCommonServiceOverride, { type OpenEditor } from './common.js' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors.js' +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices.js' +import { MonacoEditorService } from '../tools/editor.js' +import { IDiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService.service.js' +import { DiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService.js' +export type { OpenEditor, IEditorOptions, IResolvedTextEditorModel, IReference } from './common.js' + +export default function getServiceOverride(openEditor: OpenEditor): IEditorOverrideServices { + return { + ...getCommonServiceOverride(openEditor), + [IEditorService.toString()]: new SyncDescriptor( + MonacoEditorService, + [openEditor, () => false], + true + ), + [IDiffEditorCommandsService.toString()]: new SyncDescriptor(DiffEditorCommandsService, [], true) + } +} + +export { MonacoEditorService } diff --git a/src/service-override/editor.ts b/src/service-override/editor/common.ts similarity index 88% rename from src/service-override/editor.ts rename to src/service-override/editor/common.ts index 0061ade9..3bcb0f23 100644 --- a/src/service-override/editor.ts +++ b/src/service-override/editor/common.ts @@ -1,35 +1,31 @@ -import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { mainWindow } from 'vs/base/browser/window' import { Event } from 'vs/base/common/event' -import type { IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService' +import type { IReference } from 'vs/base/common/lifecycle' import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService.service' -import { CodeEditorService } from 'vs/workbench/services/editor/browser/codeEditorService' -import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service' +import type { IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService' +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import type { IEditorOptions } from 'vs/platform/editor/common/editor' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import type { IReference } from 'vs/base/common/lifecycle' -import { TextEditorService } from 'vs/workbench/services/textfile/common/textEditorService' -import { ITextEditorService } from 'vs/workbench/services/textfile/common/textEditorService.service' +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' +import { DEFAULT_EDITOR_PART_OPTIONS } from 'vs/workbench/browser/parts/editor/editor' +import 'vs/workbench/browser/parts/editor/editor.contribution._autosave.js' +import 'vs/workbench/contrib/files/browser/fileCommands._save.js' +import 'vs/workbench/contrib/files/browser/files.contribution._fileEditorFactory.js' +import { CodeEditorService } from 'vs/workbench/services/editor/browser/codeEditorService' import { GroupOrientation, type IEditorPart, type IModalEditorPart } from 'vs/workbench/services/editor/common/editorGroupsService' import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService.service' -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' -import { DEFAULT_EDITOR_PART_OPTIONS } from 'vs/workbench/browser/parts/editor/editor' -import { IDiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService.service' -import { DiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService' -import { mainWindow } from 'vs/base/browser/window' +import { TextEditorService } from 'vs/workbench/services/textfile/common/textEditorService' +import { ITextEditorService } from 'vs/workbench/services/textfile/common/textEditorService.service' +import { unsupported } from '../../tools.js' import { MonacoDelegateEditorGroupsService, - MonacoEditorService, type OpenEditor, fakeActiveGroup -} from './tools/editor' -import { unsupported } from '../tools' -import 'vs/workbench/browser/parts/editor/editor.contribution._autosave.js' -import 'vs/workbench/contrib/files/browser/files.contribution._fileEditorFactory.js' -import 'vs/workbench/contrib/files/browser/fileCommands._save.js' +} from '../tools/editor.js' class EmptyEditorPart implements IEditorPart { onWillDispose = Event.None @@ -177,16 +173,9 @@ class MonacoEditorGroupsService extends MonacoDelegateEditorGroupsService false], - true - ), [ITextEditorService.toString()]: new SyncDescriptor(TextEditorService, [], false), - [IEditorGroupsService.toString()]: new SyncDescriptor(MonacoEditorGroupsService, [openEditor]), - [IDiffEditorCommandsService.toString()]: new SyncDescriptor(DiffEditorCommandsService, [], true) + [IEditorGroupsService.toString()]: new SyncDescriptor(MonacoEditorGroupsService, [openEditor]) } } -export { MonacoEditorService } -export type { OpenEditor, IEditorOptions, IResolvedTextEditorModel, IReference } +export type { IEditorOptions, IReference, IResolvedTextEditorModel, OpenEditor } diff --git a/src/service-override/editor/session.ts b/src/service-override/editor/session.ts new file mode 100644 index 00000000..b223e33c --- /dev/null +++ b/src/service-override/editor/session.ts @@ -0,0 +1,23 @@ +import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service.js' +import getCommonServiceOverride, { type OpenEditor } from './common.js' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors.js' +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices.js' +import { MonacoEditorService } from '../tools/editor.js' +import { EditorParts } from 'vs/sessions/browser/parts/editorParts.js' +import { IDiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService.service.js' +import { SessionsDiffEditorCommandsService } from 'vs/sessions/contrib/editor/browser/diffEditor.sessions.contribution.js' +export type { OpenEditor, IEditorOptions, IResolvedTextEditorModel, IReference } from './common.js' + +export default function getServiceOverride(openEditor: OpenEditor): IEditorOverrideServices { + return { + ...getCommonServiceOverride(openEditor), + [IEditorService.toString()]: new SyncDescriptor(EditorParts, [], true), + [IDiffEditorCommandsService.toString()]: new SyncDescriptor( + SessionsDiffEditorCommandsService, + [], + true + ) + } +} + +export { MonacoEditorService } diff --git a/src/service-override/extensionGallery/classic.ts b/src/service-override/extensionGallery/classic.ts new file mode 100644 index 00000000..f37f4c6c --- /dev/null +++ b/src/service-override/extensionGallery/classic.ts @@ -0,0 +1,30 @@ +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { IExtensionRecommendationNotificationService } from 'vs/platform/extensionRecommendations/common/extensionRecommendations.service' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { ExtensionRecommendationNotificationService } from 'vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService' +import { ExtensionRecommendationsService } from 'vs/workbench/contrib/extensions/browser/extensionRecommendationsService' +import { IExtensionRecommendationsService } from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations.service' + +import getCommonServiceOverride, { type ExtensionGalleryOptions } from './common.js' +import 'vs/workbench/contrib/extensions/browser/extensions.contribution' + +export default function getServiceOverride({ + webOnly = false, + transformExtensionGalleryManifest +}: ExtensionGalleryOptions = {}): IEditorOverrideServices { + return { + ...getCommonServiceOverride({ webOnly, transformExtensionGalleryManifest }), + [IExtensionRecommendationsService.toString()]: new SyncDescriptor( + ExtensionRecommendationsService, + [], + true + ), + [IExtensionRecommendationNotificationService.toString()]: new SyncDescriptor( + ExtensionRecommendationNotificationService, + [], + true + ) + } +} + +export type { IExtensionGalleryManifest, ExtensionGalleryOptions } from './common.js' diff --git a/src/service-override/extensionGallery.ts b/src/service-override/extensionGallery/common.ts similarity index 89% rename from src/service-override/extensionGallery.ts rename to src/service-override/extensionGallery/common.ts index abe8a3d7..47852134 100644 --- a/src/service-override/extensionGallery.ts +++ b/src/service-override/extensionGallery/common.ts @@ -1,6 +1,8 @@ +import { Emitter } from 'vs/base/common/event.js' import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { AllowedExtensionsService } from 'vs/platform/extensionManagement/common/allowedExtensionsService' import { GlobalExtensionEnablementService } from 'vs/platform/extensionManagement/common/extensionEnablementService' +import type { IExtensionGalleryManifest } from 'vs/platform/extensionManagement/common/extensionGalleryManifest.js' import { IExtensionGalleryManifestService } from 'vs/platform/extensionManagement/common/extensionGalleryManifest.service.js' import { IAllowedExtensionsService, @@ -11,18 +13,17 @@ import { import { IExtensionsProfileScannerService } from 'vs/platform/extensionManagement/common/extensionsProfileScannerService.service' import { IExtensionsScannerService } from 'vs/platform/extensionManagement/common/extensionsScannerService.service' import { ExtensionTipsService } from 'vs/platform/extensionManagement/common/extensionTipsService' -import { IExtensionRecommendationNotificationService } from 'vs/platform/extensionRecommendations/common/extensionRecommendations.service' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' import { ILabelService } from 'vs/platform/label/common/label.service' import { getLocale } from 'vs/platform/languagePacks/common/languagePacks' +import { IProductService } from 'vs/platform/product/common/productService.service.js' import { IgnoredExtensionsManagementService } from 'vs/platform/userDataSync/common/ignoredExtensions' import { IIgnoredExtensionsManagementService } from 'vs/platform/userDataSync/common/ignoredExtensions.service' -import { ExtensionRecommendationNotificationService } from 'vs/workbench/contrib/extensions/browser/extensionRecommendationNotificationService' -import { ExtensionRecommendationsService } from 'vs/workbench/contrib/extensions/browser/extensionRecommendationsService' import { ExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/browser/extensionsWorkbenchService' import type { IExtension as IContribExtension } from 'vs/workbench/contrib/extensions/common/extensions' import { IExtensionsWorkbenchService } from 'vs/workbench/contrib/extensions/common/extensions.service' +import 'vs/workbench/contrib/extensions/browser/extensions.web.contribution' import { ExtensionEnablementService } from 'vs/workbench/services/extensionManagement/browser/extensionEnablementService' import { WebExtensionGalleryManifestService } from 'vs/workbench/services/extensionManagement/browser/extensionGalleryManifestService' import { ExtensionsProfileScannerService } from 'vs/workbench/services/extensionManagement/browser/extensionsProfileScannerService' @@ -37,10 +38,7 @@ import { import { ExtensionManagementServerService } from 'vs/workbench/services/extensionManagement/common/extensionManagementServerService' import { ExtensionManagementService } from 'vs/workbench/services/extensionManagement/common/extensionManagementService' import { ExtensionIgnoredRecommendationsService } from 'vs/workbench/services/extensionRecommendations/common/extensionIgnoredRecommendationsService' -import { - IExtensionIgnoredRecommendationsService, - IExtensionRecommendationsService -} from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations.service' +import { IExtensionIgnoredRecommendationsService } from 'vs/workbench/services/extensionRecommendations/common/extensionRecommendations.service' import { WorkspaceExtensionsConfigService } from 'vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig' import { IWorkspaceExtensionsConfigService } from 'vs/workbench/services/extensionRecommendations/common/workspaceExtensionsConfig.service' import { ExtensionsScannerService } from 'vs/workbench/services/extensions/browser/extensionsScannerService' @@ -51,23 +49,18 @@ import { IExtensionManifestPropertiesService } from 'vs/workbench/services/exten import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService.service' import { RemoteUserDataProfilesService } from 'vs/workbench/services/userDataProfile/common/remoteUserDataProfiles' import { IRemoteUserDataProfilesService } from 'vs/workbench/services/userDataProfile/common/remoteUserDataProfiles.service' -import { registerAssets } from '../assets.js' -import { isLocaleAvailable } from '../l10n.js' -import { unsupported } from '../tools' -import 'vs/workbench/contrib/extensions/browser/extensions.contribution' -import 'vs/workbench/contrib/extensions/browser/extensions.web.contribution' -import type { IExtensionGalleryManifest } from 'vs/platform/extensionManagement/common/extensionGalleryManifest.js' -import { IProductService } from 'vs/platform/product/common/productService.service.js' -import { Emitter } from 'vs/base/common/event.js' +import { registerAssets } from '../../assets.js' +import { isLocaleAvailable } from '../../l10n.js' +import { unsupported } from '../../tools.js' // plugin-import-meta-asset only allows relative paths registerAssets({ 'vs/workbench/contrib/extensions/browser/media/theme-icon.png': new URL( - '../../vscode/src/vs/workbench/contrib/extensions/browser/media/theme-icon.png', + '../../../vscode/src/vs/workbench/contrib/extensions/browser/media/theme-icon.png', import.meta.url ).href, 'vs/workbench/contrib/extensions/browser/media/language-icon.svg': new URL( - '../../vscode/src/vs/workbench/contrib/extensions/browser/media/theme-icon.png', + '../../../vscode/src/vs/workbench/contrib/extensions/browser/media/theme-icon.png', import.meta.url ).href }) @@ -181,16 +174,6 @@ export default function getServiceOverride({ [webOnly], true ), - [IExtensionRecommendationsService.toString()]: new SyncDescriptor( - ExtensionRecommendationsService, - [], - true - ), - [IExtensionRecommendationNotificationService.toString()]: new SyncDescriptor( - ExtensionRecommendationNotificationService, - [], - true - ), [IExtensionIgnoredRecommendationsService.toString()]: new SyncDescriptor( ExtensionIgnoredRecommendationsService, [], diff --git a/src/service-override/extensionGallery/session.ts b/src/service-override/extensionGallery/session.ts new file mode 100644 index 00000000..0092a30b --- /dev/null +++ b/src/service-override/extensionGallery/session.ts @@ -0,0 +1,23 @@ +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { IExtensionRecommendationNotificationService } from 'vs/platform/extensionRecommendations/common/extensionRecommendations.service' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' + +import getCommonServiceOverride, { type ExtensionGalleryOptions } from './common.js' +import 'vs/sessions/contrib/extensions/browser/extensions.contribution' +import { NullExtensionRecommendationNotificationService } from 'vs/sessions/services/extensionRecommendations/common/extensionRecommendationNotificationService.js' + +export default function getServiceOverride({ + webOnly = false, + transformExtensionGalleryManifest +}: ExtensionGalleryOptions = {}): IEditorOverrideServices { + return { + ...getCommonServiceOverride({ webOnly, transformExtensionGalleryManifest }), + [IExtensionRecommendationNotificationService.toString()]: new SyncDescriptor( + NullExtensionRecommendationNotificationService, + [], + true + ) + } +} + +export type { IExtensionGalleryManifest, ExtensionGalleryOptions } from './common.js' diff --git a/src/service-override/github.ts b/src/service-override/github/classic.ts similarity index 100% rename from src/service-override/github.ts rename to src/service-override/github/classic.ts diff --git a/src/service-override/github/session.ts b/src/service-override/github/session.ts new file mode 100644 index 00000000..2df1dbb9 --- /dev/null +++ b/src/service-override/github/session.ts @@ -0,0 +1,11 @@ +import { type IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { GitHubService } from 'vs/sessions/contrib/github/browser/githubService' +import { IGitHubService } from 'vs/sessions/contrib/github/browser/githubService.service' +import 'vs/sessions/contrib/github/browser/github.contribution' + +export default function getServiceOverride(): IEditorOverrideServices { + return { + [IGitHubService.toString()]: new SyncDescriptor(GitHubService, [], true) + } +} diff --git a/src/service-override/keybindings.ts b/src/service-override/keybindings.ts index 40405a0c..0c270507 100644 --- a/src/service-override/keybindings.ts +++ b/src/service-override/keybindings.ts @@ -26,12 +26,12 @@ import { Schemas } from 'vs/base/common/network' import { URI } from 'vs/base/common/uri' import getFileServiceOverride, { initFile } from './files' import type { DynamicKeybindingService, KeybindingProvider } from '../monaco' +import { getService } from '../services' +import type { IKeyboardEvent } from 'vs/base/browser/keyboardEvent' import 'vs/workbench/browser/workbench.contribution' import 'vs/workbench/contrib/keybindings/browser/keybindings.contribution' import 'vs/workbench/contrib/preferences/browser/keybindingsEditorContribution' import 'vs/workbench/contrib/commands/common/commands.contribution' -import { getService } from '../services' -import type { IKeyboardEvent } from 'vs/base/browser/keyboardEvent' // This is the default value, but can be overriden by overriding the Environment or UserDataProfileService service const defaultUserKeybindindsFile = URI.from({ diff --git a/src/service-override/markers.ts b/src/service-override/markers/classic.ts similarity index 100% rename from src/service-override/markers.ts rename to src/service-override/markers/classic.ts diff --git a/src/service-override/markers/session.ts b/src/service-override/markers/session.ts new file mode 100644 index 00000000..51d3757a --- /dev/null +++ b/src/service-override/markers/session.ts @@ -0,0 +1,5 @@ +import { type IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' + +export default function getServiceOverride(): IEditorOverrideServices { + return {} +} diff --git a/src/service-override/mcp/classic.ts b/src/service-override/mcp/classic.ts new file mode 100644 index 00000000..ced25ee8 --- /dev/null +++ b/src/service-override/mcp/classic.ts @@ -0,0 +1,2 @@ +export { default } from './common' +import 'vs/workbench/contrib/mcp/browser/mcp.view.contribution' diff --git a/src/service-override/mcp.ts b/src/service-override/mcp/common.ts similarity index 98% rename from src/service-override/mcp.ts rename to src/service-override/mcp/common.ts index 615935b5..75b99ca5 100644 --- a/src/service-override/mcp.ts +++ b/src/service-override/mcp/common.ts @@ -35,7 +35,6 @@ import { McpSandboxService } from 'vs/workbench/contrib/mcp/common/mcpSandboxSer import { IWorkbenchMcpGatewayService } from 'vs/workbench/contrib/mcp/common/mcpGatewayService.service' import { BrowserMcpGatewayService } from 'vs/workbench/contrib/mcp/browser/mcpGatewayService' import 'vs/workbench/contrib/mcp/browser/mcp.contribution' -import 'vs/workbench/contrib/mcp/browser/mcp.view.contribution' import 'vs/workbench/api/browser/extensionHost.mcp.contribution' export default function getServiceOverride(): IEditorOverrideServices { diff --git a/src/service-override/mcp/session.ts b/src/service-override/mcp/session.ts new file mode 100644 index 00000000..4a864cf7 --- /dev/null +++ b/src/service-override/mcp/session.ts @@ -0,0 +1 @@ +export { default } from './common' diff --git a/src/service-override/outline/classic.ts b/src/service-override/outline/classic.ts new file mode 100644 index 00000000..18d49512 --- /dev/null +++ b/src/service-override/outline/classic.ts @@ -0,0 +1,2 @@ +export { default } from './common' +import 'vs/workbench/contrib/outline/browser/outline.contribution' diff --git a/src/service-override/outline.ts b/src/service-override/outline/common.ts similarity index 89% rename from src/service-override/outline.ts rename to src/service-override/outline/common.ts index 553c51a6..55d3f14d 100644 --- a/src/service-override/outline.ts +++ b/src/service-override/outline/common.ts @@ -1,9 +1,8 @@ import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import 'vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline' -import 'vs/workbench/contrib/outline/browser/outline.contribution' import { IOutlineService } from 'vs/workbench/services/outline/browser/outline.service' import { OutlineService } from 'vs/workbench/services/outline/browser/outlineService' +import 'vs/workbench/contrib/codeEditor/browser/outline/documentSymbolsOutline' export default function getServiceOverride(): IEditorOverrideServices { return { diff --git a/src/service-override/outline/session.ts b/src/service-override/outline/session.ts new file mode 100644 index 00000000..4a864cf7 --- /dev/null +++ b/src/service-override/outline/session.ts @@ -0,0 +1 @@ +export { default } from './common' diff --git a/src/service-override/policy/classic.ts b/src/service-override/policy/classic.ts new file mode 100644 index 00000000..a57fb553 --- /dev/null +++ b/src/service-override/policy/classic.ts @@ -0,0 +1,3 @@ +export { default } from './common' +export * from './common' +import 'vs/workbench/services/policies/browser/accountPolicyGate.contribution' diff --git a/src/service-override/policy.ts b/src/service-override/policy/common.ts similarity index 94% rename from src/service-override/policy.ts rename to src/service-override/policy/common.ts index 9ebbb958..e31026c6 100644 --- a/src/service-override/policy.ts +++ b/src/service-override/policy/common.ts @@ -8,7 +8,6 @@ import { type PolicyValue } from 'vs/platform/policy/common/policy' import { IPolicyService } from 'vs/platform/policy/common/policy.service' -import 'vs/workbench/services/policies/browser/accountPolicyGate.contribution' class PolicyService extends AbstractPolicyService { constructor(defaultPolicies: Map) { diff --git a/src/service-override/policy/session.ts b/src/service-override/policy/session.ts new file mode 100644 index 00000000..4ecc81bc --- /dev/null +++ b/src/service-override/policy/session.ts @@ -0,0 +1,2 @@ +export { default } from './common' +export * from './common' diff --git a/src/service-override/scm/classic.ts b/src/service-override/scm/classic.ts new file mode 100644 index 00000000..53b85465 --- /dev/null +++ b/src/service-override/scm/classic.ts @@ -0,0 +1,4 @@ +export { default } from './common' +export * from './common' + +import 'vs/workbench/contrib/scm/browser/scm.contribution' diff --git a/src/service-override/scm.ts b/src/service-override/scm/common.ts similarity index 96% rename from src/service-override/scm.ts rename to src/service-override/scm/common.ts index 5a98bab4..bfa2b7f1 100644 --- a/src/service-override/scm.ts +++ b/src/service-override/scm/common.ts @@ -9,7 +9,6 @@ import { IQuickDiffModelService } from 'vs/workbench/contrib/scm/browser/quickDi import { QuickDiffModelService } from 'vs/workbench/contrib/scm/browser/quickDiffModel' import { IGitService } from 'vs/workbench/contrib/git/common/gitService.service' import { GitService } from 'vs/workbench/contrib/git/browser/gitService' -import 'vs/workbench/contrib/scm/browser/scm.contribution' import 'vs/workbench/contrib/scm/browser/quickDiff.contribution' export default function getServiceOverride(): IEditorOverrideServices { diff --git a/src/service-override/scm/session.ts b/src/service-override/scm/session.ts new file mode 100644 index 00000000..4ecc81bc --- /dev/null +++ b/src/service-override/scm/session.ts @@ -0,0 +1,2 @@ +export { default } from './common' +export * from './common' diff --git a/src/service-override/search/classic.ts b/src/service-override/search/classic.ts new file mode 100644 index 00000000..6cf71f3e --- /dev/null +++ b/src/service-override/search/classic.ts @@ -0,0 +1,17 @@ +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { SearchViewModelWorkbenchService } from 'vs/workbench/contrib/search/browser/searchTreeModel/searchModel' +import { ISearchViewModelWorkbenchService } from 'vs/workbench/contrib/search/browser/searchTreeModel/searchViewModelWorkbenchService.service' +import getCommonServiceOverride from './common' +import 'vs/workbench/contrib/search/browser/search.contribution' + +export default function getServiceOverride(): IEditorOverrideServices { + return { + ...getCommonServiceOverride(), + [ISearchViewModelWorkbenchService.toString()]: new SyncDescriptor( + SearchViewModelWorkbenchService, + [], + true + ) + } +} diff --git a/src/service-override/search.ts b/src/service-override/search/common.ts similarity index 89% rename from src/service-override/search.ts rename to src/service-override/search/common.ts index 1e8c5b70..dd6015dd 100644 --- a/src/service-override/search.ts +++ b/src/service-override/search/common.ts @@ -2,15 +2,11 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { ISearchService } from 'vs/workbench/services/search/common/search.service' import { SearchService } from 'vs/workbench/services/search/common/searchService' -import { SearchViewModelWorkbenchService } from 'vs/workbench/contrib/search/browser/searchTreeModel/searchModel' -import { ISearchViewModelWorkbenchService } from 'vs/workbench/contrib/search/browser/searchTreeModel/searchViewModelWorkbenchService.service' import { SearchHistoryService } from 'vs/workbench/contrib/search/common/searchHistoryService' import { ISearchHistoryService } from 'vs/workbench/contrib/search/common/searchHistoryService.service' import { IReplaceService } from 'vs/workbench/contrib/search/browser/replace.service' import { ReplaceService } from 'vs/workbench/contrib/search/browser/replaceService' import { LocalFileSearchWorkerClient } from 'vs/workbench/services/search/browser/searchService' -import 'vs/workbench/contrib/search/browser/search.contribution' -import 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution' import { IModelService } from 'vs/editor/common/services/model.service' import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service' import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry.service' @@ -23,10 +19,11 @@ import { SearchProviderType } from 'vs/workbench/services/search/common/search' import { Schemas } from 'vs/base/common/network' import type { IFileSystemProvider } from 'vs/platform/files/common/files' import { HTMLFileSystemProvider } from 'vs/platform/files/browser/htmlFileSystemProvider' -import { WorkspaceSearchProvider } from './tools/search-providers/workspace-search-provider' +import { WorkspaceSearchProvider } from '../tools/search-providers/workspace-search-provider' import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace.service' import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService.service' import { IConfigurationService } from 'vs/platform/configuration/common/configuration.service' +import 'vs/workbench/contrib/searchEditor/browser/searchEditor.contribution' function isHTMLFileSystemProvider( provider: IFileSystemProvider @@ -96,11 +93,6 @@ class CustomSearchService extends SearchService { export default function getServiceOverride(): IEditorOverrideServices { return { [ISearchService.toString()]: new SyncDescriptor(CustomSearchService, [], true), - [ISearchViewModelWorkbenchService.toString()]: new SyncDescriptor( - SearchViewModelWorkbenchService, - [], - true - ), [ISearchHistoryService.toString()]: new SyncDescriptor(SearchHistoryService, [], true), [IReplaceService.toString()]: new SyncDescriptor(ReplaceService, [], true) } diff --git a/src/service-override/search/session.ts b/src/service-override/search/session.ts new file mode 100644 index 00000000..4cefd9ad --- /dev/null +++ b/src/service-override/search/session.ts @@ -0,0 +1,8 @@ +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import getCommonServiceOverride from './common' + +export default function getServiceOverride(): IEditorOverrideServices { + return { + ...getCommonServiceOverride() + } +} diff --git a/src/service-override/snippets.ts b/src/service-override/snippets/classic.ts similarity index 90% rename from src/service-override/snippets.ts rename to src/service-override/snippets/classic.ts index 4c23ff79..d12510b4 100644 --- a/src/service-override/snippets.ts +++ b/src/service-override/snippets/classic.ts @@ -7,8 +7,8 @@ import { ISnippetsService } from 'vs/workbench/contrib/snippets/browser/snippets import { SnippetsService } from 'vs/workbench/contrib/snippets/browser/snippetsService' import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle' import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle.service' -import getFileServiceOverride from './files' -import { registerServiceInitializeParticipant } from '../lifecycle' +import getFileServiceOverride from '../files' +import { registerServiceInitializeParticipant } from '../../lifecycle' import 'vs/workbench/contrib/snippets/browser/snippets.contribution' interface ISnippetsExtensionPoint { diff --git a/src/service-override/snippets/session.ts b/src/service-override/snippets/session.ts new file mode 100644 index 00000000..fa4b369f --- /dev/null +++ b/src/service-override/snippets/session.ts @@ -0,0 +1,3 @@ +throw new Error('Snippets service override cannot be used in session mode') + +export {} diff --git a/src/service-override/survey/classic.ts b/src/service-override/survey/classic.ts new file mode 100644 index 00000000..5c374f6a --- /dev/null +++ b/src/service-override/survey/classic.ts @@ -0,0 +1,3 @@ +export { default } from './common' +import 'vs/workbench/contrib/surveys/browser/nps.contribution' +import 'vs/workbench/contrib/surveys/browser/languageSurveys.contribution' diff --git a/src/service-override/survey.ts b/src/service-override/survey/common.ts similarity index 64% rename from src/service-override/survey.ts rename to src/service-override/survey/common.ts index 294d4c54..f751f885 100644 --- a/src/service-override/survey.ts +++ b/src/service-override/survey/common.ts @@ -1,6 +1,4 @@ import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' -import 'vs/workbench/contrib/surveys/browser/nps.contribution' -import 'vs/workbench/contrib/surveys/browser/languageSurveys.contribution' import 'vs/workbench/contrib/surveys/browser/survey.contribution' export default function getServiceOverride(): IEditorOverrideServices { diff --git a/src/service-override/survey/session.ts b/src/service-override/survey/session.ts new file mode 100644 index 00000000..4a864cf7 --- /dev/null +++ b/src/service-override/survey/session.ts @@ -0,0 +1 @@ +export { default } from './common' diff --git a/src/service-override/telemetry/classic.ts b/src/service-override/telemetry/classic.ts new file mode 100644 index 00000000..d0cbd00f --- /dev/null +++ b/src/service-override/telemetry/classic.ts @@ -0,0 +1,3 @@ +export { default } from './common' +import 'vs/workbench/services/policies/browser/policyTelemetry.contribution' +import 'vs/workbench/contrib/bracketPairColorizer2Telemetry/browser/bracketPairColorizer2Telemetry.contribution.js' diff --git a/src/service-override/telemetry.ts b/src/service-override/telemetry/common.ts similarity index 84% rename from src/service-override/telemetry.ts rename to src/service-override/telemetry/common.ts index 3900b527..ddedb349 100644 --- a/src/service-override/telemetry.ts +++ b/src/service-override/telemetry/common.ts @@ -7,8 +7,6 @@ export type { ITelemetryData, TelemetryLevel } from 'vs/platform/telemetry/commo import { DataChannelService } from 'vs/workbench/services/dataChannel/browser/dataChannelService' import 'vs/workbench/contrib/telemetry/browser/telemetry.contribution' import 'vs/workbench/contrib/editTelemetry/browser/editTelemetry.contribution' -import 'vs/workbench/contrib/bracketPairColorizer2Telemetry/browser/bracketPairColorizer2Telemetry.contribution.js' -import 'vs/workbench/services/policies/browser/policyTelemetry.contribution' export default function getServiceOverride(): IEditorOverrideServices { return { diff --git a/src/service-override/telemetry/session.ts b/src/service-override/telemetry/session.ts new file mode 100644 index 00000000..4a864cf7 --- /dev/null +++ b/src/service-override/telemetry/session.ts @@ -0,0 +1 @@ +export { default } from './common' diff --git a/src/service-override/testing.ts b/src/service-override/testing/classic.ts similarity index 98% rename from src/service-override/testing.ts rename to src/service-override/testing/classic.ts index 30420b36..50284094 100644 --- a/src/service-override/testing.ts +++ b/src/service-override/testing/classic.ts @@ -18,7 +18,7 @@ import { ITestExplorerFilterState } from 'vs/workbench/contrib/testing/common/te import { TestingPeekOpener } from 'vs/workbench/contrib/testing/browser/testingOutputPeek' import { TestCoverageService } from 'vs/workbench/contrib/testing/common/testCoverageService' import { ITestCoverageService } from 'vs/workbench/contrib/testing/common/testCoverageService.service' -import getTerminalServiceOverride from './terminal' +import getTerminalServiceOverride from '../terminal' import 'vs/workbench/contrib/testing/browser/testing.contribution' import 'vs/workbench/contrib/testing/browser/testingConfigurationUi' diff --git a/src/service-override/testing/session.ts b/src/service-override/testing/session.ts new file mode 100644 index 00000000..728ac791 --- /dev/null +++ b/src/service-override/testing/session.ts @@ -0,0 +1,18 @@ +import { type IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { + NullTestProfileService, + NullTestResultService, + NullTestService +} from 'vs/workbench/contrib/testing/common/nullTestingService' +import { ITestProfileService } from 'vs/workbench/contrib/testing/common/testProfileService.service' +import { ITestResultService } from 'vs/workbench/contrib/testing/common/testResultService.service' +import { ITestService } from 'vs/workbench/contrib/testing/common/testService.service' + +export default function getServiceOverride(): IEditorOverrideServices { + return { + [ITestService.toString()]: new SyncDescriptor(NullTestService, [], true), + [ITestProfileService.toString()]: new SyncDescriptor(NullTestProfileService, [], true), + [ITestResultService.toString()]: new SyncDescriptor(NullTestResultService, [], true) + } +} diff --git a/src/service-override/timeline/classic.ts b/src/service-override/timeline/classic.ts new file mode 100644 index 00000000..4bf8ab33 --- /dev/null +++ b/src/service-override/timeline/classic.ts @@ -0,0 +1,2 @@ +export { default } from './common' +import 'vs/workbench/contrib/timeline/browser/timeline.contribution' diff --git a/src/service-override/timeline.ts b/src/service-override/timeline/common.ts similarity index 89% rename from src/service-override/timeline.ts rename to src/service-override/timeline/common.ts index 5673e073..f25d7659 100644 --- a/src/service-override/timeline.ts +++ b/src/service-override/timeline/common.ts @@ -1,9 +1,8 @@ import { type IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import 'vs/workbench/contrib/timeline/browser/timeline.contribution' -import 'vs/workbench/contrib/localHistory/browser/localHistory.contribution' import { ITimelineService } from 'vs/workbench/contrib/timeline/common/timeline.service' import { TimelineService } from 'vs/workbench/contrib/timeline/common/timelineService' +import 'vs/workbench/contrib/localHistory/browser/localHistory.contribution' export default function getServiceOverride(): IEditorOverrideServices { return { diff --git a/src/service-override/timeline/session.ts b/src/service-override/timeline/session.ts new file mode 100644 index 00000000..4a864cf7 --- /dev/null +++ b/src/service-override/timeline/session.ts @@ -0,0 +1 @@ +export { default } from './common' diff --git a/src/service-override/userDataSync/classic.ts b/src/service-override/userDataSync/classic.ts new file mode 100644 index 00000000..c2c257e5 --- /dev/null +++ b/src/service-override/userDataSync/classic.ts @@ -0,0 +1,2 @@ +export { default } from './common' +import 'vs/workbench/contrib/userDataSync/browser/userDataSync.contribution' diff --git a/src/service-override/userDataSync.ts b/src/service-override/userDataSync/common.ts similarity index 95% rename from src/service-override/userDataSync.ts rename to src/service-override/userDataSync/common.ts index bae15f79..78e44c71 100644 --- a/src/service-override/userDataSync.ts +++ b/src/service-override/userDataSync/common.ts @@ -26,8 +26,7 @@ import { UserDataSyncResourceProviderService } from 'vs/platform/userDataSync/co import { UserDataSyncLocalStoreService } from 'vs/platform/userDataSync/common/userDataSyncLocalStoreService' import { UserDataSyncWorkbenchService } from 'vs/workbench/services/userDataSync/browser/userDataSyncWorkbenchService' import { IUserDataSyncWorkbenchService } from 'vs/workbench/services/userDataSync/common/userDataSync.service' -import getUserDataProfileServiceOverride from './userDataProfile' -import 'vs/workbench/contrib/userDataSync/browser/userDataSync.contribution' +import getUserDataProfileServiceOverride from '../userDataProfile' export default function getServiceOverride(): IEditorOverrideServices { return { diff --git a/src/service-override/userDataSync/session.ts b/src/service-override/userDataSync/session.ts new file mode 100644 index 00000000..4a864cf7 --- /dev/null +++ b/src/service-override/userDataSync/session.ts @@ -0,0 +1 @@ +export { default } from './common' diff --git a/src/service-override/viewCommon/classic.ts b/src/service-override/viewCommon/classic.ts new file mode 100644 index 00000000..34981349 --- /dev/null +++ b/src/service-override/viewCommon/classic.ts @@ -0,0 +1,15 @@ +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import getCommonServiceOverride from './common' +import { PaneCompositePartService } from 'vs/workbench/browser/parts/paneCompositePartService' +import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite.service' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import 'vs/workbench/contrib/modernUI/browser/modernUI.contribution' + +export default function getServiceOverride( + _webviewIframeAlternateDomains?: string +): IEditorOverrideServices { + return { + ...getCommonServiceOverride(_webviewIframeAlternateDomains), + [IPaneCompositePartService.toString()]: new SyncDescriptor(PaneCompositePartService, [], true) + } +} diff --git a/src/service-override/viewCommon.ts b/src/service-override/viewCommon/common.ts similarity index 91% rename from src/service-override/viewCommon.ts rename to src/service-override/viewCommon/common.ts index cde24cee..5786bb27 100644 --- a/src/service-override/viewCommon.ts +++ b/src/service-override/viewCommon/common.ts @@ -1,86 +1,84 @@ +import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService.service' import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { ActionViewItemService } from 'vs/platform/actions/browser/actionViewItemService' +import { IActionViewItemService } from 'vs/platform/actions/browser/actionViewItemService.service' +import { IContextViewService } from 'vs/platform/contextview/browser/contextView.service' +import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { IViewDescriptorService } from 'vs/workbench/common/views.service' -import { ViewDescriptorService } from 'vs/workbench/services/views/browser/viewDescriptorService' -import { IActivityService } from 'vs/workbench/services/activity/common/activity.service' -import { ActivityService } from 'vs/workbench/services/activity/browser/activityService' -import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite.service' -import { IEditorResolverService } from 'vs/workbench/services/editor/common/editorResolverService.service' -import { EditorResolverService } from 'vs/workbench/services/editor/browser/editorResolverService' +import { IProgressService } from 'vs/platform/progress/common/progress.service' import { BreadcrumbsService } from 'vs/workbench/browser/parts/editor/breadcrumbs' import { IBreadcrumbsService } from 'vs/workbench/browser/parts/editor/breadcrumbs.service' -import { IContextViewService } from 'vs/platform/contextview/browser/contextView.service' -import { ContextViewService } from 'vs/platform/contextview/browser/contextViewService' -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService.service' -import { TextEditorService } from 'vs/workbench/services/textfile/common/textEditorService' -import { ITextEditorService } from 'vs/workbench/services/textfile/common/textEditorService.service' -import { CodeEditorService } from 'vs/workbench/services/editor/browser/codeEditorService' -import { UntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService' -import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService.service' -import { IHistoryService } from 'vs/workbench/services/history/common/history.service' -import { HistoryService } from 'vs/workbench/services/history/browser/historyService' -import { ICustomEditorService } from 'vs/workbench/contrib/customEditor/common/customEditor.service' +import { IViewDescriptorService } from 'vs/workbench/common/views.service' import { CustomEditorService } from 'vs/workbench/contrib/customEditor/browser/customEditors' +import { ICustomEditorService } from 'vs/workbench/contrib/customEditor/common/customEditor.service' +import { IWebviewService } from 'vs/workbench/contrib/webview/browser/webview.service' import { WebviewService } from 'vs/workbench/contrib/webview/browser/webviewService' import { WebviewEditorService } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService' import { IWebviewWorkbenchService } from 'vs/workbench/contrib/webviewPanel/browser/webviewWorkbenchService.service' -import { IWebviewService } from 'vs/workbench/contrib/webview/browser/webview.service' import { WebviewViewService } from 'vs/workbench/contrib/webviewView/browser/webviewViewService' import { IWebviewViewService } from 'vs/workbench/contrib/webviewView/browser/webviewViewService.service' -import { IProgressService } from 'vs/platform/progress/common/progress.service' -import { ProgressService } from 'vs/workbench/services/progress/browser/progressService' -import { PaneCompositePartService } from 'vs/workbench/browser/parts/paneCompositePartService' +import { ActivityService } from 'vs/workbench/services/activity/browser/activityService' +import { IActivityService } from 'vs/workbench/services/activity/common/activity.service' import { BrowserAuxiliaryWindowService } from 'vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService' import { IAuxiliaryWindowService } from 'vs/workbench/services/auxiliaryWindow/browser/auxiliaryWindowService.service' -import { IViewsService } from 'vs/workbench/services/views/common/viewsService.service' -import { ViewsService } from 'vs/workbench/services/views/browser/viewsService' -import { IEditorPaneService } from 'vs/workbench/services/editor/common/editorPaneService.service' +import { CodeEditorService } from 'vs/workbench/services/editor/browser/codeEditorService' import { EditorPaneService } from 'vs/workbench/services/editor/browser/editorPaneService' +import { EditorResolverService } from 'vs/workbench/services/editor/browser/editorResolverService' import { CustomEditorLabelService } from 'vs/workbench/services/editor/common/customEditorLabelService' import { ICustomEditorLabelService } from 'vs/workbench/services/editor/common/customEditorLabelService.service' -import { ActionViewItemService } from 'vs/platform/actions/browser/actionViewItemService' -import { IActionViewItemService } from 'vs/platform/actions/browser/actionViewItemService.service' -import getBulkEditServiceOverride from './bulkEdit' -import { changeUrlDomain } from './tools/url.js' -import { registerAssets } from '../assets.js' -import { registerServiceInitializePostParticipant } from '../lifecycle.js' -import 'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution' -import 'vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution' -import 'vscode/src/vs/workbench/browser/parts/views/media/views.css' -import 'vs/workbench/api/browser/viewsExtensionPoint' -import 'vs/workbench/browser/parts/editor/editor.contribution' -import 'vs/workbench/browser/parts/titlebar/menubar.contribution' -import 'vs/workbench/browser/workbench.contribution' -import 'vs/workbench/browser/workbench.zenMode.contribution' +import { IEditorPaneService } from 'vs/workbench/services/editor/common/editorPaneService.service' +import { IEditorResolverService } from 'vs/workbench/services/editor/common/editorResolverService.service' +import { HistoryService } from 'vs/workbench/services/history/browser/historyService' +import { IHistoryService } from 'vs/workbench/services/history/common/history.service' +import { ProgressService } from 'vs/workbench/services/progress/browser/progressService' +import { TextEditorService } from 'vs/workbench/services/textfile/common/textEditorService' +import { ITextEditorService } from 'vs/workbench/services/textfile/common/textEditorService.service' +import { UntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService' +import { IUntitledTextEditorService } from 'vs/workbench/services/untitled/common/untitledTextEditorService.service' +import { ViewDescriptorService } from 'vs/workbench/services/views/browser/viewDescriptorService' +import { ViewsService } from 'vs/workbench/services/views/browser/viewsService' +import { IViewsService } from 'vs/workbench/services/views/common/viewsService.service' + +import { registerAssets } from '../../assets.js' +import { registerServiceInitializePostParticipant } from '../../lifecycle.js' +import getBulkEditServiceOverride from '../bulkEdit/classic.js' +import { changeUrlDomain } from '../tools/url.js' +import '../tools/editorAssets.js' import 'vs/sessions/common/theme' -import 'vs/workbench/contrib/customEditor/browser/customEditor.contribution' -import 'vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution' -import 'vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution' -import 'vs/workbench/contrib/languageStatus/browser/languageStatus.contribution' -import 'vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution' -import 'vs/workbench/contrib/webview/browser/webview.contribution' -import 'vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution' -import 'vs/workbench/contrib/sash/browser/sash.contribution' -import 'vs/workbench/contrib/preferences/browser/keyboardLayoutPicker' -import 'vs/workbench/browser/parts/editor/editor.contribution._autosave.js' -import 'vs/workbench/contrib/files/browser/files.contribution._editorPane.js' -import 'vs/workbench/contrib/files/browser/fileCommands._save.js' -import 'vs/workbench/browser/style' -import 'vs/workbench/contrib/scrollLocking/browser/scrollLocking.contribution' -import 'vs/workbench/browser/actions/textInputActions' +import 'vs/workbench/api/browser/viewsExtensionPoint' import 'vs/workbench/browser/actions/helpActions' import 'vs/workbench/browser/actions/layoutActions' import 'vs/workbench/browser/actions/listCommands' import 'vs/workbench/browser/actions/navigationActions' +import 'vs/workbench/browser/actions/textInputActions' +import 'vs/workbench/browser/actions/widgetNavigationCommands' import 'vs/workbench/browser/actions/windowActions' import 'vs/workbench/browser/actions/workspaceActions' import 'vs/workbench/browser/actions/workspaceCommands' -import 'vs/workbench/browser/actions/widgetNavigationCommands' +import 'vs/workbench/browser/parts/editor/editor.contribution' +import 'vs/workbench/browser/parts/editor/editor.contribution._autosave.js' +import 'vs/workbench/browser/style' +import 'vs/workbench/browser/workbench.contribution' +import 'vs/workbench/contrib/callHierarchy/browser/callHierarchy.contribution' +import 'vs/workbench/contrib/customEditor/browser/customEditor.contribution' +import 'vs/workbench/contrib/externalUriOpener/common/externalUriOpener.contribution' +import 'vs/workbench/contrib/files/browser/fileCommands._save.js' +import 'vs/workbench/contrib/files/browser/files.contribution._editorPane.js' +import 'vs/workbench/contrib/limitIndicator/browser/limitIndicator.contribution' +import 'vs/workbench/contrib/mergeEditor/browser/mergeEditor.contribution' +import 'vs/workbench/contrib/preferences/browser/keyboardLayoutPicker' +import 'vs/workbench/contrib/sash/browser/sash.contribution' +import 'vs/workbench/contrib/scrollLocking/browser/scrollLocking.contribution' import 'vs/workbench/contrib/splash/browser/splash.contribution' -import './tools/editorAssets.js' +import 'vs/workbench/contrib/typeHierarchy/browser/typeHierarchy.contribution' +import 'vs/workbench/contrib/webview/browser/webview.contribution' +import 'vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution' +import 'vscode/src/vs/workbench/browser/parts/views/media/views.css' // Import it from here to force the bundler to put it in this service-override package import 'vs/workbench/browser/parts/editor/editorParts' +import { ISplashStorageService } from 'vs/workbench/contrib/splash/browser/splash.service.js' +import type { IPartsSplash } from 'vs/platform/theme/common/themeService.js' let webviewIframeAlternateDomains: string | undefined registerAssets({ @@ -115,7 +113,6 @@ function getServiceOverride(_webviewIframeAlternateDomains?: string): IEditorOve [IViewsService.toString()]: new SyncDescriptor(ViewsService, [], false), [IViewDescriptorService.toString()]: new SyncDescriptor(ViewDescriptorService, [], true), [IActivityService.toString()]: new SyncDescriptor(ActivityService, [], true), - [IPaneCompositePartService.toString()]: new SyncDescriptor(PaneCompositePartService, [], true), [ICodeEditorService.toString()]: new SyncDescriptor(CodeEditorService, [], true), [ITextEditorService.toString()]: new SyncDescriptor(TextEditorService, [], false), @@ -144,7 +141,19 @@ function getServiceOverride(_webviewIframeAlternateDomains?: string): IEditorOve ), [IEditorPaneService.toString()]: new SyncDescriptor(EditorPaneService, [], true), [ICustomEditorLabelService.toString()]: new SyncDescriptor(CustomEditorLabelService, [], true), - [IActionViewItemService.toString()]: new SyncDescriptor(ActionViewItemService, [], true) + [IActionViewItemService.toString()]: new SyncDescriptor(ActionViewItemService, [], true), + [ISplashStorageService.toString()]: new SyncDescriptor( + class SplashStorageService implements ISplashStorageService { + declare readonly _serviceBrand: undefined + + async saveWindowSplash(splash: IPartsSplash): Promise { + const raw = JSON.stringify(splash) + localStorage.setItem('monaco-parts-splash', raw) + } + }, + [], + true + ) } } diff --git a/src/service-override/viewCommon/session.ts b/src/service-override/viewCommon/session.ts new file mode 100644 index 00000000..a8e5f20d --- /dev/null +++ b/src/service-override/viewCommon/session.ts @@ -0,0 +1,18 @@ +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import getCommonServiceOverride from './common' +import { AgenticPaneCompositePartService } from 'vs/sessions/browser/paneCompositePartService' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite.service' + +export default function getServiceOverride( + _webviewIframeAlternateDomains?: string +): IEditorOverrideServices { + return { + ...getCommonServiceOverride(_webviewIframeAlternateDomains), + [IPaneCompositePartService.toString()]: new SyncDescriptor( + AgenticPaneCompositePartService, + [], + true + ) + } +} diff --git a/src/service-override/viewTitleBar.ts b/src/service-override/viewTitleBar/classic.ts similarity index 89% rename from src/service-override/viewTitleBar.ts rename to src/service-override/viewTitleBar/classic.ts index ce6aa9a3..33709d7e 100644 --- a/src/service-override/viewTitleBar.ts +++ b/src/service-override/viewTitleBar/classic.ts @@ -2,7 +2,7 @@ import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/stand import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { BrowserTitleService } from 'vs/workbench/browser/parts/titlebar/titlebarPart' import { ITitleService } from 'vs/workbench/services/title/browser/titleService.service' -import { registerServiceInitializePostParticipant } from '../lifecycle' +import { registerServiceInitializePostParticipant } from '../../lifecycle' export default function getServiceOverride(): IEditorOverrideServices { return { diff --git a/src/service-override/viewTitleBar/session.ts b/src/service-override/viewTitleBar/session.ts new file mode 100644 index 00000000..fd936598 --- /dev/null +++ b/src/service-override/viewTitleBar/session.ts @@ -0,0 +1,15 @@ +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { ITitleService } from 'vs/workbench/services/title/browser/titleService.service' +import { registerServiceInitializePostParticipant } from '../../lifecycle' +import { TitleService } from 'vs/sessions/browser/parts/titlebarPart' + +export default function getServiceOverride(): IEditorOverrideServices { + return { + [ITitleService.toString()]: new SyncDescriptor(TitleService, [], false) + } +} + +registerServiceInitializePostParticipant(async (accessor) => { + accessor.get(ITitleService) +}) diff --git a/src/service-override/views.ts b/src/service-override/views/classic.ts similarity index 98% rename from src/service-override/views.ts rename to src/service-override/views/classic.ts index 05b95d8b..0f315f03 100644 --- a/src/service-override/views.ts +++ b/src/service-override/views/classic.ts @@ -60,18 +60,21 @@ import { import { StartupKind } from 'vs/workbench/services/lifecycle/common/lifecycle' import { ILifecycleService } from 'vs/workbench/services/lifecycle/common/lifecycle.service' import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite.service' -import { onRenderWorkbench } from '../lifecycle' -import { RawContextKey } from '../monaco' -import getKeybindingsOverride from './keybindings' -import { LayoutService } from './layout' -import getQuickAccessOverride from './quickaccess' +import { onRenderWorkbench } from '../../lifecycle' +import { RawContextKey } from '../../monaco' +import getKeybindingsOverride from '../keybindings' +import { LayoutService } from '../layout' +import getQuickAccessOverride from '../quickaccess' import { MonacoDelegateEditorGroupsService, MonacoEditorService, type OpenEditor -} from './tools/editor' -import getViewCommonServiceOverride from './viewCommon' -export * from './tools/views' +} from '../tools/editor' +import getViewCommonServiceOverride from '../viewCommon/classic' +export * from '../tools/views' +import 'vs/workbench/browser/parts/titlebar/menubar.contribution' +import 'vs/workbench/browser/workbench.zenMode.contribution' +import 'vs/workbench/contrib/languageStatus/browser/languageStatus.contribution' function createPart(id: string, role: string, classes: string[]): HTMLElement { const part = document.createElement( diff --git a/src/service-override/views/session.ts b/src/service-override/views/session.ts new file mode 100644 index 00000000..3b2288d8 --- /dev/null +++ b/src/service-override/views/session.ts @@ -0,0 +1,3 @@ +throw new Error('View service override cannot be used in session mode') + +export {} diff --git a/src/service-override/walkthrough.ts b/src/service-override/walkthrough/classic.ts similarity index 95% rename from src/service-override/walkthrough.ts rename to src/service-override/walkthrough/classic.ts index 066e3c56..7881482e 100644 --- a/src/service-override/walkthrough.ts +++ b/src/service-override/walkthrough/classic.ts @@ -2,11 +2,12 @@ import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/stand import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { WalkthroughsService } from 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService' import { IWalkthroughsService } from 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStartedService.service' -import 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution' -import 'vs/workbench/contrib/welcomeWalkthrough/browser/walkThrough.contribution' import svgAssets from 'vs/workbench/contrib/welcomeGettingStarted/common/media/*.svg' import pngAssets from 'vs/workbench/contrib/welcomeGettingStarted/common/media/*.png' -import { registerAssets } from '../assets' +import { registerAssets } from '../../assets' + +import 'vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution' +import 'vs/workbench/contrib/welcomeWalkthrough/browser/walkThrough.contribution' registerAssets(svgAssets) registerAssets(pngAssets) diff --git a/src/service-override/walkthrough/session.ts b/src/service-override/walkthrough/session.ts new file mode 100644 index 00000000..7a660ade --- /dev/null +++ b/src/service-override/walkthrough/session.ts @@ -0,0 +1,3 @@ +throw new Error('Walkthrough service override cannot be used in session mode') + +export {} diff --git a/src/service-override/welcome/classic.ts b/src/service-override/welcome/classic.ts new file mode 100644 index 00000000..b660107c --- /dev/null +++ b/src/service-override/welcome/classic.ts @@ -0,0 +1,14 @@ +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { IOnboardingService } from 'vs/workbench/contrib/welcomeOnboarding/common/onboardingService.service' +import { OnboardingVariationA } from 'vs/workbench/contrib/welcomeOnboarding/browser/onboardingVariationA' +import getCommonServiceOverride from './common' +import 'vs/workbench/contrib/welcomeOnboarding/browser/welcomeOnboarding.contribution' +import 'vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcome.contribution' + +export default function getServiceOverride(): IEditorOverrideServices { + return { + ...getCommonServiceOverride(), + [IOnboardingService.toString()]: new SyncDescriptor(OnboardingVariationA, [], true) + } +} diff --git a/src/service-override/welcome.ts b/src/service-override/welcome/common.ts similarity index 62% rename from src/service-override/welcome.ts rename to src/service-override/welcome/common.ts index 61e9ad13..2d3cd8de 100644 --- a/src/service-override/welcome.ts +++ b/src/service-override/welcome/common.ts @@ -2,17 +2,12 @@ import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/stand import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { IOnboardingScenarioService } from 'vs/workbench/contrib/onboarding/common/onboardingScenarioService.service' import { OnboardingScenarioService } from 'vs/workbench/contrib/onboarding/browser/onboardingService' -import { IOnboardingService } from 'vs/workbench/contrib/welcomeOnboarding/common/onboardingService.service' -import { OnboardingVariationA } from 'vs/workbench/contrib/welcomeOnboarding/browser/onboardingVariationA' import 'vs/workbench/contrib/onboarding/browser/onboarding.contribution' import 'vs/workbench/contrib/welcomeViews/common/viewsWelcome.contribution' import 'vs/workbench/contrib/welcomeViews/common/newFile.contribution' -import 'vs/workbench/contrib/welcomeOnboarding/browser/welcomeOnboarding.contribution' -import 'vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcome.contribution' export default function getServiceOverride(): IEditorOverrideServices { return { - [IOnboardingService.toString()]: new SyncDescriptor(OnboardingVariationA, [], true), [IOnboardingScenarioService.toString()]: new SyncDescriptor(OnboardingScenarioService, [], true) } } diff --git a/src/service-override/welcome/session.ts b/src/service-override/welcome/session.ts new file mode 100644 index 00000000..4cefd9ad --- /dev/null +++ b/src/service-override/welcome/session.ts @@ -0,0 +1,8 @@ +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import getCommonServiceOverride from './common' + +export default function getServiceOverride(): IEditorOverrideServices { + return { + ...getCommonServiceOverride() + } +} diff --git a/src/service-override/workbench.ts b/src/service-override/workbench/classic.ts similarity index 78% rename from src/service-override/workbench.ts rename to src/service-override/workbench/classic.ts index b5116905..95f460a8 100644 --- a/src/service-override/workbench.ts +++ b/src/service-override/workbench/classic.ts @@ -1,30 +1,30 @@ +import { setFullscreen } from 'vs/base/browser/browser' +import { detectFullscreen } from 'vs/base/browser/dom' +import { mainWindow } from 'vs/base/browser/window' +import { onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors' import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' -import { type IWorkbenchOptions, Workbench } from 'vs/workbench/browser/workbench' -import { ILogService } from 'vs/platform/log/common/log.service' -import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection' -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' -import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService.service' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService.service' -import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service' -import { EditorService } from 'vs/workbench/services/editor/browser/editorService' +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' +import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection' +import { ILogService } from 'vs/platform/log/common/log.service' import { EditorParts } from 'vs/workbench/browser/parts/editor/editorParts' -import { IWorkspaceFolderLabelService } from 'vs/workbench/services/workspaces/common/workspaceFolderLabelService.service' -import { WorkspaceFolderLabelService } from 'vs/workbench/services/workspaces/common/workspaceFolderLabelService' -import { onUnexpectedError, setUnexpectedErrorHandler } from 'vs/base/common/errors' import { BrowserWindow } from 'vs/workbench/browser/window' -import { detectFullscreen } from 'vs/base/browser/dom' -import { mainWindow } from 'vs/base/browser/window' -import { setFullscreen } from 'vs/base/browser/browser' -import getKeybindingsOverride from './keybindings' -import getQuickAccessOverride from './quickaccess' -import getTitleBarServiceOverride from './viewTitleBar' -import getStatusBarServiceOverride from './viewStatusBar' -import getBannerServiceOverride from './viewBanner' -import getViewCommonServiceOverride from './viewCommon' -import { getWorkbenchContainer } from '../workbench' -import { onLayout, onRenderWorkbench } from '../lifecycle' -export * from './tools/views' +import { type IWorkbenchOptions, Workbench } from 'vs/workbench/browser/workbench' +import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService.service' +import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService.service' +import { WorkspaceFolderLabelService } from 'vs/workbench/services/workspaces/common/workspaceFolderLabelService' +import { IWorkspaceFolderLabelService } from 'vs/workbench/services/workspaces/common/workspaceFolderLabelService.service' +import { onLayout, onRenderWorkbench } from '../../lifecycle' +import { getWorkbenchContainer } from '../../workbench' +import getBannerServiceOverride from '../viewBanner' +import getViewCommonServiceOverride from '../viewCommon/classic' +import getStatusBarServiceOverride from '../viewStatusBar' +import getTitleBarServiceOverride from '../viewTitleBar/classic' +import getCommonServiceOverride from './common' +import 'vs/workbench/browser/parts/titlebar/menubar.contribution' +import 'vs/workbench/browser/workbench.zenMode.contribution' +import 'vs/workbench/contrib/languageStatus/browser/languageStatus.contribution' +export * from '../tools/views' class CustomWorkbench extends Workbench { constructor( @@ -75,17 +75,10 @@ function getServiceOverride( _webviewIframeAlternateDomains?: string ): IEditorOverrideServices { return { + ...getCommonServiceOverride(), ...getViewCommonServiceOverride(_webviewIframeAlternateDomains), - ...getQuickAccessOverride({ - isKeybindingConfigurationVisible: () => true, - shouldUseGlobalPicker: () => true - }), - ...getKeybindingsOverride({ - shouldUseGlobalKeybindings: () => true - }), [IWorkbenchLayoutService.toString()]: new SyncDescriptor(CustomWorkbench, [options], false), [IEditorGroupsService.toString()]: new SyncDescriptor(EditorParts, [], false), - [IEditorService.toString()]: new SyncDescriptor(EditorService, [undefined], false), [IWorkspaceFolderLabelService.toString()]: new SyncDescriptor( WorkspaceFolderLabelService, [], diff --git a/src/service-override/workbench/common.ts b/src/service-override/workbench/common.ts new file mode 100644 index 00000000..c72e38c2 --- /dev/null +++ b/src/service-override/workbench/common.ts @@ -0,0 +1,19 @@ +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import getQuickAccessOverride from '../quickaccess' +import getKeybindingsOverride from '../keybindings' +import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service' +import { EditorService } from 'vs/workbench/services/editor/browser/editorService' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' + +export default function getServiceOverride(): IEditorOverrideServices { + return { + ...getQuickAccessOverride({ + isKeybindingConfigurationVisible: () => true, + shouldUseGlobalPicker: () => true + }), + ...getKeybindingsOverride({ + shouldUseGlobalKeybindings: () => true + }), + [IEditorService.toString()]: new SyncDescriptor(EditorService, [undefined], false) + } +} diff --git a/src/service-override/workbench/session.ts b/src/service-override/workbench/session.ts new file mode 100644 index 00000000..138b0a21 --- /dev/null +++ b/src/service-override/workbench/session.ts @@ -0,0 +1,353 @@ +import { setFullscreen } from 'vs/base/browser/browser' +import { detectFullscreen } from 'vs/base/browser/dom' +import { mainWindow } from 'vs/base/browser/window' +import { setUnexpectedErrorHandler } from 'vs/base/common/errors' +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { RemoteAgentHostLocationPreferenceService } from 'vs/platform/agentHost/browser/remoteAgentHostLocationPreferenceService' +import { IAgentHostByokLmHandler } from 'vs/platform/agentHost/common/agentHostByokLm.service.js' +import { + ICloudSandboxAgentHostService, + ICloudSandboxApiService +} from 'vs/platform/agentHost/common/cloudSandboxAgentHost.service' +import { IRemoteAgentHostLocationPreferenceService } from 'vs/platform/agentHost/common/remoteAgentHostLocationPreference.service.js' +import { ITunnelAgentHostService } from 'vs/platform/agentHost/common/tunnelAgentHost.service' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' +import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection' +import { ILogService } from 'vs/platform/log/common/log.service' +import { IChatDashboardService } from 'vs/sessions/browser/chatDashboardService.service.js' +import { CustomViewGridParts } from 'vs/sessions/browser/parts/customViewGridParts' +import { MobileVisualViewport } from 'vs/sessions/browser/parts/mobile/mobileVisualViewport' +import { IMobileVisualViewport } from 'vs/sessions/browser/parts/mobile/mobileVisualViewport.service' +import { SessionsParts } from 'vs/sessions/browser/parts/sessionsParts' +import { SessionsSetUpService } from 'vs/sessions/browser/sessionsSetUpService' +import { ISessionsSetUpService } from 'vs/sessions/browser/sessionsSetUpService.service' +import { Workbench, type IWorkbenchOptions } from 'vs/sessions/browser/workbench' +import { IDevContainerAgentHostService } from 'vs/sessions/common/devContainerAgentHostService.service' +import { ChatDashboardServiceImpl } from 'vs/sessions/contrib/accountMenu/browser/account.contribution' +import { IAgentFeedbackService } from 'vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.service.js' +import { NullAgentFeedbackService } from 'vs/sessions/contrib/agentFeedback/browser/nullAgentFeedbackService.contribution.js' +import { AquariumService } from 'vs/sessions/contrib/aquarium/browser/aquariumOverlay.js' +import { IAquariumService } from 'vs/sessions/contrib/aquarium/browser/aquariumOverlay.service.js' +import { AutomationDialogService } from 'vs/sessions/contrib/automations/browser/automationDialogService' +import { AutomationRunner } from 'vs/sessions/contrib/automations/browser/automationRunner' +import { BrowserAutomationStorageService } from 'vs/sessions/contrib/automations/browser/automationStorageService' +import { ProviderAutomationService } from 'vs/sessions/contrib/automations/browser/providerAutomationService' +import { IAutomationStorageService } from 'vs/sessions/contrib/automations/common/automationStorageService.service.js' +import { SessionChangesService } from 'vs/sessions/contrib/changes/browser/sessionChangesService.js' +import { ISessionChangesService } from 'vs/sessions/contrib/changes/common/sessionChangesService.service.js' +import { ChatViewFactory } from 'vs/sessions/contrib/chat/browser/chatView' +import { SessionsChatViewStateService } from 'vs/sessions/contrib/chat/browser/chatViewStateService' +import { ISessionsChatViewStateService } from 'vs/sessions/contrib/chat/browser/chatViewStateService.service.js' +import { SessionsCustomizationHarnessService } from 'vs/sessions/contrib/chat/browser/customizationHarnessService' +import { NewChatVoiceTargetService } from 'vs/sessions/contrib/chat/browser/newChatVoice' +import { INewChatVoiceTargetService } from 'vs/sessions/contrib/chat/browser/newChatVoice.service.js' +import { NewSessionComposerService } from 'vs/sessions/contrib/chat/browser/newSessionComposerService' +import { INewSessionComposerService } from 'vs/sessions/contrib/chat/browser/newSessionComposerService.service.js' +import { SessionArchiveNudgeService } from 'vs/sessions/contrib/chat/browser/sessionArchiveNudge' +import { ISessionArchiveNudgeService } from 'vs/sessions/contrib/chat/browser/sessionArchiveNudge.service.js' +import { SessionChatPillsDebugService } from 'vs/sessions/contrib/chat/browser/sessionChatInputToolbarDebug' +import { ISessionChatPillsDebugService } from 'vs/sessions/contrib/chat/browser/sessionChatInputToolbarDebug.service.js' +import { SessionTaskRunnerRegistry } from 'vs/sessions/contrib/chat/browser/sessionTaskRunner.js' +import { ISessionTaskRunnerRegistry } from 'vs/sessions/contrib/chat/browser/sessionTaskRunner.service.js' +import { SessionsTasksService } from 'vs/sessions/contrib/chat/browser/sessionsTasksService.js' +import { ISessionsTasksService } from 'vs/sessions/contrib/chat/browser/sessionsTasksService.service.js' +import { CodeReviewService } from 'vs/sessions/contrib/codeReview/browser/codeReviewService' +import { ICodeReviewService } from 'vs/sessions/contrib/codeReview/browser/codeReviewService.service.js' +import { DiffEditorOptionsService } from 'vs/sessions/contrib/editor/browser/diffEditorOptionsService' +import { IDiffEditorOptionsService } from 'vs/sessions/contrib/editor/common/diffEditorOptionsService.service' +import { GitHubService } from 'vs/sessions/contrib/github/browser/githubService' +import { IGitHubService } from 'vs/sessions/contrib/github/browser/githubService.service' +import { PullRequestIconCache } from 'vs/sessions/contrib/github/browser/pullRequestIconCache' +import { IPullRequestIconCache } from 'vs/sessions/contrib/github/browser/pullRequestIconCache.service' +import { CloudSandboxAgentHostService } from 'vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxAgentHostService' +import { CloudSandboxApiService } from 'vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxApiService' +import { CloudSandboxTelemetryService } from 'vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxTelemetry' +import { ICloudSandboxTelemetryService } from 'vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxTelemetry.service' +import { DevContainerAgentHostService } from 'vs/sessions/contrib/providers/remoteAgentHost/browser/devContainerAgentHostService' +import { RemoteAgentHostConnectionCustomizationService } from 'vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostConnectionCustomization' +import { IRemoteAgentHostConnectionCustomizationService } from 'vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostConnectionCustomization.service' +import { BrowserTunnelAgentHostServiceSelector } from 'vs/sessions/contrib/providers/remoteAgentHost/browser/webTunnelAgentHostService.contribution' +import { AgentHostFilterService } from 'vs/sessions/services/agentHostFilter/browser/agentHostFilterService' +import { IAgentHostFilterService } from 'vs/sessions/services/agentHostFilter/common/agentHostFilter.service' +import { SessionsChatBackgroundService } from 'vs/sessions/services/chatBackground/browser/chatBackgroundService' +import { ISessionsChatBackgroundService } from 'vs/sessions/services/chatBackground/browser/chatBackgroundService.service.js' +import { IChatViewFactory } from 'vs/sessions/services/chatView/browser/chatViewFactory.service.js' +import { ICustomViewGridPartService } from 'vs/sessions/services/customView/browser/customViewGridPartService.service' +import { CustomViewService } from 'vs/sessions/services/customView/browser/customViewService' +import { ICustomViewService } from 'vs/sessions/services/customView/browser/customViewService.service' +import { ActiveSessionContext } from 'vs/sessions/services/sessions/browser/sessionContext' +import { ISessionContext } from 'vs/sessions/services/sessions/browser/sessionContext.service' +import { SessionGroupsService } from 'vs/sessions/services/sessions/browser/sessionGroupsService' +import { ISessionGroupsService } from 'vs/sessions/services/sessions/browser/sessionGroupsService.service' +import { SessionOpenTelemetryService } from 'vs/sessions/services/sessions/browser/sessionOpenTelemetryService' +import { ISessionOpenTelemetryService } from 'vs/sessions/services/sessions/browser/sessionOpenTelemetryService.service' +import { SessionSectionOrderService } from 'vs/sessions/services/sessions/browser/sessionSectionOrderService' +import { ISessionSectionOrderService } from 'vs/sessions/services/sessions/browser/sessionSectionOrderService.service' +import { SessionsListModelService } from 'vs/sessions/services/sessions/browser/sessionsListModelService' +import { ISessionsListModelService } from 'vs/sessions/services/sessions/browser/sessionsListModelService.service' +import { SessionsManagementService } from 'vs/sessions/services/sessions/browser/sessionsManagementService' +import { ISessionsPartService } from 'vs/sessions/services/sessions/browser/sessionsPartService.service' +import { SessionsProvidersService } from 'vs/sessions/services/sessions/browser/sessionsProvidersService' +import { ISessionsProvidersService } from 'vs/sessions/services/sessions/browser/sessionsProvidersService.service' +import { SessionsRecentWorkspacesService } from 'vs/sessions/services/sessions/browser/sessionsRecentWorkspacesService' +import { ISessionsRecentWorkspacesService } from 'vs/sessions/services/sessions/browser/sessionsRecentWorkspacesService.service' +import { SessionsService } from 'vs/sessions/services/sessions/browser/sessionsService' +import { ISessionsService } from 'vs/sessions/services/sessions/browser/sessionsService.service.js' +import { SessionsWindowUsageService } from 'vs/sessions/services/sessions/browser/sessionsWindowUsageService' +import { ISessionsWindowUsageService } from 'vs/sessions/services/sessions/browser/sessionsWindowUsageService.service.js' +import { SessionChangesStatsCache } from 'vs/sessions/services/sessions/common/sessionChangesStatsCache' +import { ISessionChangesStatsCache } from 'vs/sessions/services/sessions/common/sessionChangesStatsCache.service.js' +import { ISessionsManagementService } from 'vs/sessions/services/sessions/common/sessionsManagement.service' +import { SessionsWorkspaceFolderLabelService } from 'vs/sessions/services/workspaceFolderLabel/browser/workspaceFolderLabelService' +import { BrowserWindow } from 'vs/workbench/browser/window' +import { AgentHostByokLmHandler } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostByokLmHandler' +import { IAutomationDialogService } from 'vs/workbench/contrib/chat/common/automations/automationDialogService.service.js' +import { IAutomationRunner } from 'vs/workbench/contrib/chat/common/automations/automationRunner.service.js' +import { IAutomationService } from 'vs/workbench/contrib/chat/common/automations/automationService.service.js' +import { ICustomizationHarnessService } from 'vs/workbench/contrib/chat/common/customizationHarnessService.service.js' +import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService.service' +import { IWorkspaceFolderLabelService } from 'vs/workbench/services/workspaces/common/workspaceFolderLabelService.service' +import { onLayout, onRenderWorkbench } from '../../lifecycle' +import { getWorkbenchContainer } from '../../workbench' +import getChatServiceOverride from '../chat/session' +import getBannerServiceOverride from '../viewBanner' +import getViewCommonServiceOverride from '../viewCommon/session' +import getStatusBarServiceOverride from '../viewStatusBar' +import getCommonServiceOverride from './common' +export * from '../tools/views' +import 'vs/sessions/browser/parts/menubar.contribution' +import 'vs/sessions/browser/sessions.web.contribution' +import 'vs/sessions/contrib/accountMenu/browser/account.contribution' +import 'vs/sessions/contrib/aiCustomizationTreeView/browser/aiCustomizationTreeView.contribution' +import 'vs/sessions/contrib/aquarium/browser/aquarium.contribution' +import 'vs/sessions/contrib/automations/browser/automations.contribution' +import 'vs/sessions/contrib/browserView/browser/sessionBrowserView.contribution' +import 'vs/sessions/contrib/changes/browser/changes.contribution' +import 'vs/sessions/contrib/chatDebug/browser/chatDebug.contribution' +import 'vs/sessions/contrib/customViewTest/browser/customViewTest.contribution' +import 'vs/sessions/contrib/editor/browser/diffEditor.sessions.contribution' +import 'vs/sessions/contrib/editor/browser/editor.contribution' +import 'vs/sessions/contrib/editor/browser/emptyFileEditor.contribution' +import 'vs/sessions/contrib/fileTreeView/browser/fileTreeView.contribution' +import 'vs/sessions/contrib/files/browser/files.contribution' +import 'vs/sessions/contrib/layout/browser/sessions.layout.contribution' +import 'vs/sessions/contrib/onboardingTours/browser/onboardingTours.contribution' +import 'vs/sessions/contrib/policyBlocked/browser/policyBlocked.contribution' +import 'vs/workbench/contrib/search/browser/search.common.contribution' +import 'vs/sessions/contrib/search/browser/search.contribution' +import 'vs/workbench/contrib/search/browser/searchQuickAccess.contribution' +import 'vs/sessions/contrib/search/browser/searchEditorEmptyState.contribution' +import 'vs/sessions/contrib/sessions/browser/customizationsToolbar.contribution' +import 'vs/sessions/contrib/sessions/browser/sessions.contribution' +import 'vs/sessions/contrib/sessions/browser/sessionsTelemetry.contribution' +import 'vs/sessions/contrib/workspace/browser/workspace.contribution' + +class CustomWorkbench extends Workbench { + constructor( + options: IWorkbenchOptions | undefined, + @ILogService logService: ILogService, + @IInstantiationService private _instantiationService: IInstantiationService + ) { + super(getWorkbenchContainer(), options, new ServiceCollection(), logService) + + this.mainContainer.classList.add('monaco-workbench-part') + } + + protected override registerErrorHandler(logService: ILogService): void { + // prevent intercepting global error events + setUnexpectedErrorHandler((error) => this.handleUnexpectedError(error, logService)) + } + + protected override createNotificationsHandlers() { + this.registerNotificationRowHeight() + + // nothing, it's done in the notification service override + // Register with Layout + } + + protected override initServices(): IInstantiationService { + return this._instantiationService + } + + protected override restore(): void { + performance.measure( + 'perf: workbench create & restore', + 'code/didLoadWorkbenchMain', + 'code/didStartWorkbench' + ) + + // Restore parts (open default view containers) + this.restoreParts() + + // Restore the sessions that were visible in the grid. + void this.sessionsService.restoreVisibleSessions().catch((e) => { + this.logService.error('[Workbench] restoreVisibleSessions failed', e) + }) + + // prevent managing lifecycle service phase as it's already done in lifecycle.ts + } +} + +onLayout(async (accessor) => { + ;(accessor.get(IWorkbenchLayoutService) as Workbench).startup() + const detectedFullScreen = detectFullscreen(mainWindow, getWorkbenchContainer()) + setFullscreen(detectedFullScreen != null && !detectedFullScreen.guess, mainWindow) +}) +onRenderWorkbench(async (accessor) => { + accessor.get(IInstantiationService).createInstance(BrowserWindow) +}) + +export default function getServiceOverride( + options?: IWorkbenchOptions, + _webviewIframeAlternateDomains?: string +): IEditorOverrideServices { + return { + ...getCommonServiceOverride(), + ...getViewCommonServiceOverride(_webviewIframeAlternateDomains), + + [IWorkbenchLayoutService.toString()]: new SyncDescriptor(CustomWorkbench, [options], false), + [IWorkspaceFolderLabelService.toString()]: new SyncDescriptor( + SessionsWorkspaceFolderLabelService, + [], + true + ), + ...getStatusBarServiceOverride(), + ...getBannerServiceOverride(), + + [ISessionsSetUpService.toString()]: new SyncDescriptor(SessionsSetUpService, [], true), + + [ICustomViewGridPartService.toString()]: new SyncDescriptor(CustomViewGridParts, [], true), + + [ISessionsPartService.toString()]: new SyncDescriptor(SessionsParts, [], true), + + [IMobileVisualViewport.toString()]: new SyncDescriptor(MobileVisualViewport, [], true), + + ...getChatServiceOverride(), + + // Specific services + [IRemoteAgentHostLocationPreferenceService.toString()]: new SyncDescriptor( + RemoteAgentHostLocationPreferenceService, + [], + true + ), + [IChatDashboardService.toString()]: new SyncDescriptor(ChatDashboardServiceImpl, [], true), + [IAgentFeedbackService.toString()]: new SyncDescriptor(NullAgentFeedbackService, [], true), + [IAquariumService.toString()]: new SyncDescriptor(AquariumService, [], true), + [IAutomationStorageService.toString()]: new SyncDescriptor( + BrowserAutomationStorageService, + [], + true + ), + [IAutomationService.toString()]: new SyncDescriptor(ProviderAutomationService, [], true), + [IAutomationRunner.toString()]: new SyncDescriptor(AutomationRunner, [], true), + [IAutomationDialogService.toString()]: new SyncDescriptor(AutomationDialogService, [], true), + [ISessionChangesService.toString()]: new SyncDescriptor(SessionChangesService, [], true), + [ISessionTaskRunnerRegistry.toString()]: new SyncDescriptor( + SessionTaskRunnerRegistry, + [], + true + ), + [ISessionsTasksService.toString()]: new SyncDescriptor(SessionsTasksService, [], true), + [ICustomizationHarnessService.toString()]: new SyncDescriptor( + SessionsCustomizationHarnessService, + [], + true + ), + [IChatViewFactory.toString()]: new SyncDescriptor(ChatViewFactory, [], true), + [ISessionsChatViewStateService.toString()]: new SyncDescriptor( + SessionsChatViewStateService, + [], + true + ), + [ISessionsChatBackgroundService.toString()]: new SyncDescriptor( + SessionsChatBackgroundService, + [], + true + ), + [ISessionArchiveNudgeService.toString()]: new SyncDescriptor( + SessionArchiveNudgeService, + [], + true + ), + [INewChatVoiceTargetService.toString()]: new SyncDescriptor( + NewChatVoiceTargetService, + [], + true + ), + [INewSessionComposerService.toString()]: new SyncDescriptor( + NewSessionComposerService, + [], + true + ), + [ISessionChatPillsDebugService.toString()]: new SyncDescriptor( + SessionChatPillsDebugService, + [], + true + ), + [IAgentHostByokLmHandler.toString()]: new SyncDescriptor(AgentHostByokLmHandler, [], true), + [ICodeReviewService.toString()]: new SyncDescriptor(CodeReviewService, [], true), + [IDiffEditorOptionsService.toString()]: new SyncDescriptor(DiffEditorOptionsService, [], true), + [IGitHubService.toString()]: new SyncDescriptor(GitHubService, [], true), + [IPullRequestIconCache.toString()]: new SyncDescriptor(PullRequestIconCache, [], true), + [ICloudSandboxTelemetryService.toString()]: new SyncDescriptor( + CloudSandboxTelemetryService, + [], + true + ), + [ICloudSandboxApiService.toString()]: new SyncDescriptor(CloudSandboxApiService, [], true), + [ICloudSandboxAgentHostService.toString()]: new SyncDescriptor( + CloudSandboxAgentHostService, + [], + true + ), + [IDevContainerAgentHostService.toString()]: new SyncDescriptor( + DevContainerAgentHostService, + [], + true + ), + [IRemoteAgentHostConnectionCustomizationService.toString()]: new SyncDescriptor( + RemoteAgentHostConnectionCustomizationService, + [], + true + ), + [ITunnelAgentHostService.toString()]: new SyncDescriptor( + BrowserTunnelAgentHostServiceSelector, + [], + true + ), + [IAgentHostFilterService.toString()]: new SyncDescriptor(AgentHostFilterService, [], true), + [ICustomViewService.toString()]: new SyncDescriptor(CustomViewService, [], true), + [ISessionContext.toString()]: new SyncDescriptor(ActiveSessionContext, [], true), + [ISessionGroupsService.toString()]: new SyncDescriptor(SessionGroupsService, [], true), + [ISessionOpenTelemetryService.toString()]: new SyncDescriptor( + SessionOpenTelemetryService, + [], + true + ), + [ISessionSectionOrderService.toString()]: new SyncDescriptor( + SessionSectionOrderService, + [], + true + ), + [ISessionsListModelService.toString()]: new SyncDescriptor(SessionsListModelService, [], true), + [ISessionsManagementService.toString()]: new SyncDescriptor( + SessionsManagementService, + [], + true + ), + [ISessionsProvidersService.toString()]: new SyncDescriptor(SessionsProvidersService, [], true), + [ISessionsRecentWorkspacesService.toString()]: new SyncDescriptor( + SessionsRecentWorkspacesService, + [], + true + ), + [ISessionsService.toString()]: new SyncDescriptor(SessionsService, [], true), + [ISessionsWindowUsageService.toString()]: new SyncDescriptor( + SessionsWindowUsageService, + [], + true + ), + [ISessionChangesStatsCache.toString()]: new SyncDescriptor(SessionChangesStatsCache, [], true) + } +} From 03ee5ff6f0a4af3050b5d7c46c7c2d5d1777cd5a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:24:51 +0200 Subject: [PATCH 05/35] feat: make rollup config handle service-override multiple entries (classic + session) --- rollup/rollup.config.ts | 27 +++++++++--- rollup/tools/configuredSubpackagePlugin.ts | 51 +++++++++++++++++++--- 2 files changed, 64 insertions(+), 14 deletions(-) diff --git a/rollup/rollup.config.ts b/rollup/rollup.config.ts index 4acf3065..807a4b45 100644 --- a/rollup/rollup.config.ts +++ b/rollup/rollup.config.ts @@ -35,6 +35,21 @@ import { import { transformImportEqualsTransformerFactory } from './tools/typescript.js' import json from '@rollup/plugin-json' +const serviceOverrideDir = nodePath.resolve(SRC_DIR, 'service-override') +const serviceOverrideEntries = fs + .readdirSync(serviceOverrideDir, { withFileTypes: true }) + .flatMap((entry) => { + if (entry.isFile()) { + return [entry.name] + } + if (entry.isDirectory()) { + return ['classic.ts', 'session.ts'] + .map((name) => nodePath.join(entry.name, name)) + .filter((name) => fs.existsSync(nodePath.resolve(serviceOverrideDir, name))) + } + return [] + }) + const input = { 'extension.api': './src/extension.api.ts', 'editor.api': './src/editor.api.ts', @@ -50,14 +65,12 @@ const input = { monaco: './src/monaco.ts', css: './src/css.ts', ...Object.fromEntries( - fs - .readdirSync(nodePath.resolve(SRC_DIR, 'service-override'), { withFileTypes: true }) - .filter((f) => f.isFile()) - .map((f) => f.name) - .map((name) => [ - `service-override/${nodePath.basename(name, '.ts')}`, + serviceOverrideEntries.map((name) => { + return [ + `service-override/${name.slice(0, -nodePath.posix.extname(name).length)}`, `./src/service-override/${name}` - ]) + ] + }) ), ...Object.fromEntries( fs diff --git a/rollup/tools/configuredSubpackagePlugin.ts b/rollup/tools/configuredSubpackagePlugin.ts index 6a2ade35..816cddfa 100644 --- a/rollup/tools/configuredSubpackagePlugin.ts +++ b/rollup/tools/configuredSubpackagePlugin.ts @@ -83,7 +83,10 @@ export function configuredSubpackagePlugin(): rollup.Plugin { const getGroupName = (id: string) => { if (id.startsWith(serviceOverrideDir)) { - const name = changeCase.kebabCase(nodePath.basename(id, '.js')) + const relativePath = nodePath.relative(serviceOverrideDir, id) + const name = changeCase.kebabCase( + nodePath.basename(relativePath.split(nodePath.sep)[0]!, '.js') + ) return `service-override:${name}` } if (id === nodePath.resolve(options.dir!, 'editor.api.js')) { @@ -334,10 +337,19 @@ ${code}` } if (groups.size === 1 && groups.values().next().value!.startsWith('service-override:')) { - // replace input list by Record to be able to name the entrypoint "index" and the worker entrypoint "worker" - const serviceOverrideEntryPoint = (rollupOptions.input as string[]).find((e) => + // replace input list by Record to name the classic entrypoint "index" and preserve secondary entrypoints + const serviceOverrideEntryPoints = (rollupOptions.input as string[]).filter((e) => e.includes('/service-override/') - )! + ) + const serviceOverrideEntryPoint = + serviceOverrideEntryPoints.find((e) => nodePath.basename(e) === 'classic.js') ?? + serviceOverrideEntryPoints.find( + (e) => + nodePath.basename(nodePath.dirname(e)) === 'service-override' && e.endsWith('.js') + )! + const sessionEntryPoint = serviceOverrideEntryPoints.find( + (e) => nodePath.basename(e) === 'session.js' + ) const workerEntryPoint = (rollupOptions.input as string[]).find((e) => e.includes('/workers/') ) @@ -345,6 +357,12 @@ ${code}` rollupOptions.input = { index: serviceOverrideEntryPoint, 'index.d': serviceOverrideEntryPoint.replace(/\.js$/, '.d.ts'), + ...(sessionEntryPoint != null + ? { + session: sessionEntryPoint, + 'session.d': sessionEntryPoint.replace(/\.js$/, '.d.ts') + } + : {}), ...(workerEntryPoint != null ? { worker: workerEntryPoint @@ -356,11 +374,22 @@ ${code}` return rollupOptions }, getInterPackageImport(path, groupSetName) { - if (/service-override\/[a-zA-Z]+\.(js|d\.ts)$/.exec(path) != null) { + const packageName = groupSetName.alias ?? groupSetName.name + const normalizedPath = path.split(nodePath.sep).join('/') + const nestedServiceOverride = /^service-override\/[^/]+\/(classic|session)\.(js|d\.ts)$/.exec( + normalizedPath + ) + if (nestedServiceOverride?.[1] === 'classic') { + return packageName + } + if (nestedServiceOverride?.[1] === 'session') { + return `${packageName}/session` + } + if (/^service-override\/[^/]+\.(js|d\.ts)$/.exec(normalizedPath) != null) { // reference the package entrypoint - return groupSetName.alias ?? groupSetName.name + return packageName } - return `${groupSetName.alias ?? groupSetName.name}/${path.replace(/vscode\/src\//, 'vscode/').replace(/\.(js|d\.ts)$/, '')}` + return `${packageName}/${normalizedPath.replace(/vscode\/src\//, 'vscode/').replace(/\.(js|d\.ts)$/, '')}` }, getManifest(packageName, groups, entrypoints, manifest, allExternalDependencies) { const externalDependencies: SubPackageExternalDependency[] = [] @@ -542,6 +571,14 @@ ${code}` } } : {}), + ...(entrypoints.has('session.js') + ? { + './session': { + types: './session.d.ts', + default: './session.js' + } + } + : {}), './*': { types: './*.d.ts', default: './*.js' From d16d1ff5200618e6a1d80d1b94d77c2cdcd066eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:25:53 +0200 Subject: [PATCH 06/35] feat: add a script to check missing imported contributions --- package.json | 7 +- scripts/check-workbench-contributions.ts | 239 +++++++++++++++++++++++ 2 files changed, 244 insertions(+), 2 deletions(-) create mode 100644 scripts/check-workbench-contributions.ts diff --git a/package.json b/package.json index a054c8b8..cedadb83 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ }, "type": "module", "scripts": { - "build": "npm run clean && npm run lint && npm run check-unsupported-decorator && npm run compile && npm run compile-rollup-plugins && npm run compile-default-extensions && npm run compile-language-packs && npm run compile-monaco-languages", + "build": "npm run clean && npm run lint && npm run run-checks && npm run compile && npm run compile-rollup-plugins && npm run compile-default-extensions && npm run compile-language-packs && npm run compile-monaco-languages", "compile": "NODE_OPTIONS=--max_old_space_size=16384 rollup --config rollup/rollup.config.ts --configPlugin 'typescript={tsconfig: `tsconfig.rollup-config.json`}' --vscode-version ${npm_package_config_vscode_version} --vscode-ref ${npm_package_config_vscode_ref} --vscode-commit ${npm_package_config_vscode_commit}", "compile-default-extensions": "NODE_OPTIONS=--max_old_space_size=16384 rollup --config rollup/rollup.default-extensions.ts --configPlugin 'typescript={tsconfig: `tsconfig.rollup-config-default-extensions.json`}'", "compile-language-packs": "NODE_OPTIONS=--max_old_space_size=16384 rollup --config rollup/rollup.language-packs.ts --configPlugin 'typescript={tsconfig: `tsconfig.rollup-config-language-packs.json`}'", @@ -27,7 +27,10 @@ "update-vscode-dependencies": "tsx scripts/update-vscode-dependencies.ts", "release": "tsx release.ts", "reset:repo": "git clean -f -X -d", - "check-unsupported-decorator": "tsx scripts/check-unsupported-decorator.ts" + "run-checks": "npm run check-unsupported-decorator && npm run check-workbench-contributions && npm run check-sessions-contributions", + "check-unsupported-decorator": "tsx scripts/check-unsupported-decorator.ts", + "check-workbench-contributions": "tsx scripts/check-workbench-contributions.ts workbench", + "check-sessions-contributions": "tsx scripts/check-workbench-contributions.ts sessions" }, "config": { "vscode": { diff --git a/scripts/check-workbench-contributions.ts b/scripts/check-workbench-contributions.ts new file mode 100644 index 00000000..80f92002 --- /dev/null +++ b/scripts/check-workbench-contributions.ts @@ -0,0 +1,239 @@ +import path from 'node:path' +import { fileURLToPath } from 'node:url' +import glob from 'fast-glob' +import ts from 'typescript' + +const repositoryRoot = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..') +const sourceRoot = path.join(repositoryRoot, 'src') +const vscodeSourceRoot = path.join(repositoryRoot, 'vscode/src') +const contributionFilePattern = /\.contribution\.[cm]?[jt]sx?$/ +const sourceFilePattern = 'src/**/*.{ts,tsx,js,jsx,mjs,cjs}' + +const checks = { + workbench: { + entryPoint: 'vs/workbench/workbench.web.main.js', + excludedSourceFilePattern: 'src/service-override/*/session.ts' + }, + sessions: { + entryPoint: 'vs/sessions/sessions.web.main.js', + excludedSourceFilePattern: 'src/service-override/*/classic.ts' + } +} as const + +const checkName = process.argv[2] ?? 'workbench' +if (!(checkName in checks)) { + throw new Error( + `Unknown contribution check "${checkName}". Expected: ${Object.keys(checks).join(', ')}` + ) +} + +const check = checks[checkName as keyof typeof checks] +const entryPoint = path.join(vscodeSourceRoot, check.entryPoint) + +const configPath = path.join(repositoryRoot, 'tsconfig.json') +const config = ts.readConfigFile(configPath, ts.sys.readFile) + +if (config.error != null) { + throw new Error(ts.flattenDiagnosticMessageText(config.error.messageText, '\n')) +} + +const { options } = ts.parseJsonConfigFileContent(config.config, ts.sys, repositoryRoot) + +function isInside(parent: string, candidate: string): boolean { + const relativePath = path.relative(parent, candidate) + return ( + relativePath !== '..' && + !relativePath.startsWith(`..${path.sep}`) && + !path.isAbsolute(relativePath) + ) +} + +interface ImportedModule { + moduleName: string + sideEffectOnly: boolean +} + +interface ImportGraph { + contributionCandidates: Set + visited: Set +} + +function getImportedModules(filePath: string): ImportedModule[] { + const sourceText = ts.sys.readFile(filePath) + if (sourceText == null) { + throw new Error(`Unable to read ${path.relative(repositoryRoot, filePath)}`) + } + + const sourceFile = ts.createSourceFile( + filePath, + sourceText, + ts.ScriptTarget.Latest, + false, + filePath.endsWith('x') ? ts.ScriptKind.TSX : ts.ScriptKind.TS + ) + const importedModules: ImportedModule[] = [] + + for (const statement of sourceFile.statements) { + if (ts.isImportDeclaration(statement) && ts.isStringLiteral(statement.moduleSpecifier)) { + importedModules.push({ + moduleName: statement.moduleSpecifier.text, + sideEffectOnly: statement.importClause == null + }) + } else if ( + ts.isExportDeclaration(statement) && + statement.moduleSpecifier != null && + ts.isStringLiteral(statement.moduleSpecifier) + ) { + importedModules.push({ + moduleName: statement.moduleSpecifier.text, + sideEffectOnly: false + }) + } + } + + return importedModules +} + +function containsNoContributionSideEffects(filePath: string): boolean { + const sourceText = ts.sys.readFile(filePath) + if (sourceText == null) { + throw new Error(`Unable to read ${path.relative(repositoryRoot, filePath)}`) + } + + const sourceFile = ts.createSourceFile( + filePath, + sourceText, + ts.ScriptTarget.Latest, + false, + filePath.endsWith('x') ? ts.ScriptKind.TSX : ts.ScriptKind.TS + ) + + return sourceFile.statements.every((statement) => { + if ( + ts.isImportDeclaration(statement) || + ts.isImportEqualsDeclaration(statement) || + ts.isClassDeclaration(statement) + ) { + return true + } + + if (!ts.isExpressionStatement(statement) || !ts.isCallExpression(statement.expression)) { + return false + } + + const calledExpression = statement.expression.expression + return ts.isIdentifier(calledExpression) && calledExpression.text === 'registerSingleton' + }) +} + +function resolveImportedModule(moduleName: string, containingFile: string): string | undefined { + const resolvedFile = ts.resolveModuleName(moduleName, containingFile, options, ts.sys) + .resolvedModule?.resolvedFileName + if (resolvedFile == null) { + return undefined + } + + const runtimeFile = resolvedFile + .replace(/\.d\.mts$/, '.mjs') + .replace(/\.d\.cts$/, '.cjs') + .replace(/\.d\.ts$/, '.js') + + return runtimeFile !== resolvedFile && ts.sys.fileExists(runtimeFile) ? runtimeFile : resolvedFile +} + +function getModuleName(filePath: string): string { + return path + .relative(vscodeSourceRoot, filePath) + .split(path.sep) + .join('/') + .replace(/\.[cm]?[jt]sx?$/, '') +} + +function analyzeImportGraph(entryPoints: string[], excludedFiles = new Set()): ImportGraph { + const contributionCandidates = new Set() + const visited = new Set() + const pending = [...entryPoints] + + while (pending.length > 0) { + const filePath = path.resolve(pending.pop()!) + if (visited.has(filePath) || excludedFiles.has(filePath)) { + continue + } + visited.add(filePath) + + const isContributionFile = + isInside(vscodeSourceRoot, filePath) && contributionFilePattern.test(filePath) + if (isContributionFile && !containsNoContributionSideEffects(filePath)) { + contributionCandidates.add(filePath) + } + + for (const importedModule of getImportedModules(filePath)) { + const resolvedFile = resolveImportedModule(importedModule.moduleName, filePath) + if ( + resolvedFile != null && + (isInside(sourceRoot, resolvedFile) || isInside(vscodeSourceRoot, resolvedFile)) + ) { + if ( + isContributionFile && + importedModule.sideEffectOnly && + isInside(vscodeSourceRoot, resolvedFile) + ) { + contributionCandidates.add(resolvedFile) + } + pending.push(resolvedFile) + } + } + } + + return { contributionCandidates, visited } +} + +function getContributions(graph: ImportGraph, candidates: Set): Set { + return new Set( + [...candidates] + .filter((candidate) => graph.visited.has(candidate)) + .map((candidate) => getModuleName(candidate)) + ) +} + +const sourceFiles = await glob(sourceFilePattern, { + absolute: true, + cwd: repositoryRoot, + ignore: [check.excludedSourceFilePattern] +}) +const excludedSourceFiles = new Set( + await glob(check.excludedSourceFilePattern, { absolute: true, cwd: repositoryRoot }) +) + +const entryPointGraph = analyzeImportGraph([entryPoint]) +const sourceGraph = analyzeImportGraph(sourceFiles, excludedSourceFiles) +const contributionCandidates = new Set([ + ...entryPointGraph.contributionCandidates, + ...sourceGraph.contributionCandidates +]) +const entryPointContributions = getContributions(entryPointGraph, contributionCandidates) +const sourceContributions = getContributions(sourceGraph, contributionCandidates) +const onlyInEntryPoint = [...entryPointContributions] + .filter((contribution) => !sourceContributions.has(contribution)) + .sort() +const onlyInSource = [...sourceContributions] + .filter((contribution) => !entryPointContributions.has(contribution)) + .sort() + +if (onlyInEntryPoint.length > 0) { + console.error(`Contributions imported only from vscode/src/${check.entryPoint}:`) + console.error(onlyInEntryPoint.map((contribution) => ` - ${contribution}`).join('\n')) +} + +if (onlyInSource.length > 0) { + console.error('Contributions imported only from src:') + console.error(onlyInSource.map((contribution) => ` - ${contribution}`).join('\n')) +} + +if (onlyInEntryPoint.length > 0 || onlyInSource.length > 0) { + process.exitCode = 1 +} else { + console.log( + `All ${entryPointContributions.size} ${checkName} contributions are imported from src.` + ) +} From 0aa8f385a5c97b0e9d7b43ac9dc439233b9480fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:26:29 +0200 Subject: [PATCH 07/35] feat: extract meteredConnection contribution into own service-override --- src/service-override/base.ts | 5 +---- src/service-override/meteredConnection/classic.ts | 11 +++++++++++ src/service-override/meteredConnection/session.ts | 3 +++ 3 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 src/service-override/meteredConnection/classic.ts create mode 100644 src/service-override/meteredConnection/session.ts diff --git a/src/service-override/base.ts b/src/service-override/base.ts index 1fae0ae5..1e1414bb 100644 --- a/src/service-override/base.ts +++ b/src/service-override/base.ts @@ -44,8 +44,6 @@ import { IRandomService } from 'vs/workbench/contrib/editTelemetry/browser/rando import { RandomService } from 'vs/workbench/contrib/editTelemetry/browser/randomService' import { registerServiceInitializeParticipant } from '../lifecycle' import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' -import { IMeteredConnectionService } from 'vs/platform/meteredConnection/common/meteredConnection.service' -import { MeteredConnectionService } from 'vs/platform/meteredConnection/browser/meteredConnectionService' class BrowserPathServiceOverride extends AbstractPathService { constructor( @@ -97,7 +95,6 @@ export default function getServiceOverride(): IEditorOverrideServices { [], true ), - [IRandomService.toString()]: new SyncDescriptor(RandomService, [], true), - [IMeteredConnectionService.toString()]: new SyncDescriptor(MeteredConnectionService, [], true) + [IRandomService.toString()]: new SyncDescriptor(RandomService, [], true) } } diff --git a/src/service-override/meteredConnection/classic.ts b/src/service-override/meteredConnection/classic.ts new file mode 100644 index 00000000..e17f5e91 --- /dev/null +++ b/src/service-override/meteredConnection/classic.ts @@ -0,0 +1,11 @@ +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { MeteredConnectionService } from 'vs/platform/meteredConnection/browser/meteredConnectionService' +import { IMeteredConnectionService } from 'vs/platform/meteredConnection/common/meteredConnection.service' +import 'vs/workbench/contrib/meteredConnection/browser/meteredConnection.contribution' + +export default function getServiceOverride(): IEditorOverrideServices { + return { + [IMeteredConnectionService.toString()]: new SyncDescriptor(MeteredConnectionService, [], true) + } +} diff --git a/src/service-override/meteredConnection/session.ts b/src/service-override/meteredConnection/session.ts new file mode 100644 index 00000000..265e90bf --- /dev/null +++ b/src/service-override/meteredConnection/session.ts @@ -0,0 +1,3 @@ +throw new Error('MeteredConnection service override cannot be used in session mode') + +export {} From 351053091cce510b6d1cfa5bf69f57e589d4fdae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:27:05 +0200 Subject: [PATCH 08/35] fix: fix rollup plugin build --- rollup/rollup.rollup-plugins.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rollup/rollup.rollup-plugins.config.ts b/rollup/rollup.rollup-plugins.config.ts index 8240050b..4c712a4d 100644 --- a/rollup/rollup.rollup-plugins.config.ts +++ b/rollup/rollup.rollup-plugins.config.ts @@ -29,9 +29,9 @@ const config: rollup.RollupOptions[] = [ output: 'dist/packages/monaco-vscode-rollup-extension-directory-plugin', description: `Rollup plugin used to load VSCode extension already extracted inside a directory, designed to be used with ${pkg.name}` } -].flatMap(({ input, output, description }) => [ +].flatMap(({ input, output, description }): rollup.RollupOptions[] => [ { - external: [...Object.keys({ ...pkg.dependencies }), '@rollup/pluginutils'], + external: [...Object.keys({ ...pkg.dependencies }), '@rollup/pluginutils', /.*\.css$/], output: [ { format: 'esm', From 74968d216ae80bd4dc3da352727552b05d9ccfdf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:27:30 +0200 Subject: [PATCH 09/35] fix: stop synchronizing tsx with vscode --- scripts/update-vscode-dependencies.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/update-vscode-dependencies.ts b/scripts/update-vscode-dependencies.ts index cfbef944..bc818234 100644 --- a/scripts/update-vscode-dependencies.ts +++ b/scripts/update-vscode-dependencies.ts @@ -5,7 +5,7 @@ import { fileURLToPath } from 'url' const __dirname = path.dirname(fileURLToPath(import.meta.url)) const EXCLUDE_VSCODE_DEPENDENCIES = - /^(typescript.*|rollup.*|@rollup\/.*|oxlint|@vscode\/vscode-languagedetection|@types\/.*|prettier|postcss.*|zx)$/ + /^(tsx|typescript.*|rollup.*|@rollup\/.*|oxlint|@vscode\/vscode-languagedetection|@types\/.*|prettier|postcss.*|zx)$/ function getAbsolutePackageJsonPath(relativePath: string) { return path.join(__dirname, relativePath, 'package.json') From d8becb6905a0d987f96c880540ae1d0bd85f3493 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:28:19 +0200 Subject: [PATCH 10/35] fix: organize contribution: add missing one and move some others --- src/contributions.ts | 6 +++++- src/service-override/accessibility.ts | 1 + src/service-override/log.ts | 1 + src/service-override/theme.ts | 1 - 4 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/contributions.ts b/src/contributions.ts index 18356cb4..72c55ce2 100644 --- a/src/contributions.ts +++ b/src/contributions.ts @@ -14,6 +14,9 @@ import 'vs/workbench/contrib/codeEditor/browser/toggleRenderControlCharacter' import 'vs/workbench/contrib/codeEditor/browser/toggleWordWrap' import 'vs/workbench/contrib/codeEditor/browser/toggleRenderWhitespace' import 'vs/workbench/contrib/codeEditor/browser/editorLineNumberMenu' +import 'vs/workbench/contrib/codeEditor/browser/toggleColumnSelection' +import 'vs/workbench/contrib/codeEditor/browser/toggleOvertype' +import 'vs/workbench/contrib/markdown/common/markdownColors' import 'vs/workbench/contrib/format/browser/format.contribution' import 'vs/workbench/contrib/folding/browser/folding.contribution' @@ -21,8 +24,9 @@ import 'vs/workbench/contrib/inlayHints/browser/inlayHintsAccessibilty' import 'vs/workbench/contrib/codeActions/browser/codeActions.contribution' import 'vs/workbench/contrib/list/browser/list.contribution' import 'vs/workbench/contrib/codeEditor/browser/editorFeatures' +import 'vs/workbench/contrib/codeEditor/browser/editorSettingsMigration' +import 'vs/workbench/contrib/codeEditor/browser/inspectKeybindings' import 'vs/workbench/browser/actions/developerActions' import 'vs/workbench/contrib/dropOrPasteInto/browser/dropOrPasteInto.contribution' -import 'vs/workbench/contrib/meteredConnection/browser/meteredConnection.contribution' import 'vs/workbench/contrib/inlineCompletions/browser/inlineCompletions.contribution' import 'vs/workbench/contrib/opener/browser/opener.contribution' diff --git a/src/service-override/accessibility.ts b/src/service-override/accessibility.ts index 52712357..f2d99228 100644 --- a/src/service-override/accessibility.ts +++ b/src/service-override/accessibility.ts @@ -12,6 +12,7 @@ import { AccessibilityService } from 'vs/platform/accessibility/browser/accessib import { registerAssets } from '../assets' import 'vs/workbench/contrib/accessibility/browser/accessibility.contribution' import 'vs/workbench/contrib/codeEditor/browser/accessibility/accessibility' +import 'vs/workbench/contrib/codeEditor/browser/editorFindAccessibilityHelp' import 'vs/workbench/contrib/accessibilitySignals/browser/accessibilitySignal.contribution' registerAssets(audioAssets) diff --git a/src/service-override/log.ts b/src/service-override/log.ts index 60201126..c2b7b5d1 100644 --- a/src/service-override/log.ts +++ b/src/service-override/log.ts @@ -22,6 +22,7 @@ import getEnvironmentServiceOverride from './environment' import { logsPath } from '../workbench' import { checkServicesNotInitialized } from '../lifecycle' import { rendererLogLabel } from '../override/vs/workbench/browser/web.main' +import 'vs/workbench/contrib/logs/browser/logs.contribution' import 'vs/workbench/contrib/logs/common/logs.contribution' class _FileLoggerService extends FileLoggerService { diff --git a/src/service-override/theme.ts b/src/service-override/theme.ts index cbe8d0d0..6be84fd8 100644 --- a/src/service-override/theme.ts +++ b/src/service-override/theme.ts @@ -8,7 +8,6 @@ import { ConfigurationTarget } from 'vs/platform/configuration/common/configurat import type { IDisposable } from 'vs/base/common/lifecycle' import getFileServiceOverride from './files' import 'vs/workbench/contrib/themes/browser/themes.contribution' -import 'vs/workbench/contrib/modernUI/browser/modernUI.contribution' class StandaloneWorkbenchThemeService extends WorkbenchThemeService From 32ac586b4f58426f27600d71016f88ccb6b70fe6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:28:31 +0200 Subject: [PATCH 11/35] fix: missing service impl --- src/service-override/ai.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/service-override/ai.ts b/src/service-override/ai.ts index 929c7cf6..6b758151 100644 --- a/src/service-override/ai.ts +++ b/src/service-override/ai.ts @@ -1,5 +1,7 @@ import { type IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { AICustomizationItemsModel } from 'vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel' +import { IAICustomizationItemsModel } from 'vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.service' import { IAiEmbeddingVectorService } from 'vs/workbench/services/aiEmbeddingVector/common/aiEmbeddingVectorService.service' import { IAiRelatedInformationService } from 'vs/workbench/services/aiRelatedInformation/common/aiRelatedInformation.service' import { AiRelatedInformationService } from 'vs/workbench/services/aiRelatedInformation/common/aiRelatedInformationService' @@ -18,9 +20,7 @@ export default function getServiceOverride(): IEditorOverrideServices { [], true ), - [IAiSettingsSearchService.toString()] : new SyncDescriptor(AiSettingsSearchService, - [], - true - ) + [IAiSettingsSearchService.toString()]: new SyncDescriptor(AiSettingsSearchService, [], true), + [IAICustomizationItemsModel.toString()]: new SyncDescriptor(AICustomizationItemsModel, [], true) } } From 930eb0fe13f79f40a4492dfffc929f4f329bc94a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:28:52 +0200 Subject: [PATCH 12/35] fix: override dependency types to prevent having to pull the whole dependency --- .../remoteAgentHost/browser/devTunnelsWebLoader.d.ts | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 src/override/vs/sessions/contrib/providers/remoteAgentHost/browser/devTunnelsWebLoader.d.ts diff --git a/src/override/vs/sessions/contrib/providers/remoteAgentHost/browser/devTunnelsWebLoader.d.ts b/src/override/vs/sessions/contrib/providers/remoteAgentHost/browser/devTunnelsWebLoader.d.ts new file mode 100644 index 00000000..3d6764c5 --- /dev/null +++ b/src/override/vs/sessions/contrib/providers/remoteAgentHost/browser/devTunnelsWebLoader.d.ts @@ -0,0 +1,4 @@ +export type ManagementClientConformance = any +export type RelayClientConformance = any +export declare function loadDevTunnelsWeb(): Promise +export {} From 144f7bfe17fdf8cbb0c4789cc87e84ed022455c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:29:30 +0200 Subject: [PATCH 13/35] feat: export new service identifiers --- src/services.ts | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/services.ts b/src/services.ts index bd6af936..51a51aee 100644 --- a/src/services.ts +++ b/src/services.ts @@ -765,3 +765,54 @@ export { IChatGoalSummaryService } from 'vs/workbench/contrib/chat/browser/chatG export { IAgentHostCustomizationService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.service' export { IAgentHostActiveClientService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostActiveClientService.service' export { IAgentEditorCommentsBridge } from 'vs/workbench/services/agentEditorComments/common/agentEditorComments.service' +export { IAgentHostByokLmHandler } from 'vs/platform/agentHost/common/agentHostByokLm.service' +export { + ICloudSandboxAgentHostService, + ICloudSandboxApiService +} from 'vs/platform/agentHost/common/cloudSandboxAgentHost.service' +export { IRemoteAgentHostLocationPreferenceService } from 'vs/platform/agentHost/common/remoteAgentHostLocationPreference.service' +export { ITunnelAgentHostService } from 'vs/platform/agentHost/common/tunnelAgentHost.service' +export { IChatDashboardService } from 'vs/sessions/browser/chatDashboardService.service' +export { IMobileVisualViewport } from 'vs/sessions/browser/parts/mobile/mobileVisualViewport.service' +export { ISessionsSetUpService } from 'vs/sessions/browser/sessionsSetUpService.service' +export { IDevContainerAgentHostService } from 'vs/sessions/common/devContainerAgentHostService.service' +export { IAgentFeedbackService } from 'vs/sessions/contrib/agentFeedback/browser/agentFeedbackService.service' +export { IAquariumService } from 'vs/sessions/contrib/aquarium/browser/aquariumOverlay.service' +export { IAutomationStorageService } from 'vs/sessions/contrib/automations/common/automationStorageService.service' +export { IChangesViewService } from 'vs/sessions/contrib/changes/common/changesViewService.service' +export { ISessionChangesService } from 'vs/sessions/contrib/changes/common/sessionChangesService.service' +export { ISessionsChatViewStateService } from 'vs/sessions/contrib/chat/browser/chatViewStateService.service' +export { INewChatVoiceTargetService } from 'vs/sessions/contrib/chat/browser/newChatVoice.service' +export { INewSessionComposerService } from 'vs/sessions/contrib/chat/browser/newSessionComposerService.service' +export { ISessionArchiveNudgeService } from 'vs/sessions/contrib/chat/browser/sessionArchiveNudge.service' +export { ISessionChatPillsDebugService } from 'vs/sessions/contrib/chat/browser/sessionChatInputToolbarDebug.service' +export { ISessionTaskRunnerRegistry } from 'vs/sessions/contrib/chat/browser/sessionTaskRunner.service' +export { ISessionsTasksService } from 'vs/sessions/contrib/chat/browser/sessionsTasksService.service' +export { ICodeReviewService } from 'vs/sessions/contrib/codeReview/browser/codeReviewService.service' +export { IDiffEditorOptionsService } from 'vs/sessions/contrib/editor/common/diffEditorOptionsService.service' +export { IGitHubService } from 'vs/sessions/contrib/github/browser/githubService.service' +export { IPullRequestIconCache } from 'vs/sessions/contrib/github/browser/pullRequestIconCache.service' +export { ICloudSandboxTelemetryService } from 'vs/sessions/contrib/providers/remoteAgentHost/browser/cloudSandboxTelemetry.service' +export { IRemoteAgentHostConnectionCustomizationService } from 'vs/sessions/contrib/providers/remoteAgentHost/browser/remoteAgentHostConnectionCustomization.service' +export { IAgentHostFilterService } from 'vs/sessions/services/agentHostFilter/common/agentHostFilter.service' +export { ISessionsChatBackgroundService } from 'vs/sessions/services/chatBackground/browser/chatBackgroundService.service' +export { IChatViewFactory } from 'vs/sessions/services/chatView/browser/chatViewFactory.service' +export { ICustomViewGridPartService } from 'vs/sessions/services/customView/browser/customViewGridPartService.service' +export { ICustomViewService } from 'vs/sessions/services/customView/browser/customViewService.service' +export { ISessionContext } from 'vs/sessions/services/sessions/browser/sessionContext.service' +export { ISessionGroupsService } from 'vs/sessions/services/sessions/browser/sessionGroupsService.service' +export { ISessionOpenTelemetryService } from 'vs/sessions/services/sessions/browser/sessionOpenTelemetryService.service' +export { ISessionSectionOrderService } from 'vs/sessions/services/sessions/browser/sessionSectionOrderService.service' +export { ISessionsListModelService } from 'vs/sessions/services/sessions/browser/sessionsListModelService.service' +export { ISessionsPartService } from 'vs/sessions/services/sessions/browser/sessionsPartService.service' +export { ISessionsProvidersService } from 'vs/sessions/services/sessions/browser/sessionsProvidersService.service' +export { ISessionsRecentWorkspacesService } from 'vs/sessions/services/sessions/browser/sessionsRecentWorkspacesService.service' +export { ISessionsService } from 'vs/sessions/services/sessions/browser/sessionsService.service' +export { ISessionsWindowUsageService } from 'vs/sessions/services/sessions/browser/sessionsWindowUsageService.service' +export { ISessionChangesStatsCache } from 'vs/sessions/services/sessions/common/sessionChangesStatsCache.service' +export { ISessionsManagementService } from 'vs/sessions/services/sessions/common/sessionsManagement.service' +export { IAutomationDialogService } from 'vs/workbench/contrib/chat/common/automations/automationDialogService.service' +export { IAutomationRunner } from 'vs/workbench/contrib/chat/common/automations/automationRunner.service' +export { IAutomationService } from 'vs/workbench/contrib/chat/common/automations/automationService.service' +export { IAgentWorkbenchLayoutService } from 'vs/sessions/browser/workbench.service' +export { IAICustomizationItemsModel } from 'vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationItemsModel.service' From cda0441531a028d908186f68bd8e92cd43d00e9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:31:16 +0200 Subject: [PATCH 14/35] fix(demo): prevent vite warning --- demo/vite.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/demo/vite.config.ts b/demo/vite.config.ts index cbe11726..8e10ad12 100644 --- a/demo/vite.config.ts +++ b/demo/vite.config.ts @@ -61,7 +61,7 @@ export default defineConfig({ if (pathname.endsWith('.html')) { res.setHeader('Content-Type', 'text/html') res.writeHead(200) - res.write(fs.readFileSync(path.join(__dirname, pathname))) + res.write(fs.readFileSync(path.join(import.meta.dirname, pathname))) res.end() } } @@ -102,7 +102,7 @@ export default defineConfig({ } }, define: { - rootDirectory: JSON.stringify(__dirname) + rootDirectory: JSON.stringify(import.meta.dirname) }, resolve: { dedupe: ['vscode', ...localDependencies] From d9713606aea8a8faa303b1e047774ca06a338ccd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:31:33 +0200 Subject: [PATCH 15/35] feat(demo): add new service overrides --- demo/src/setup.common.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/demo/src/setup.common.ts b/demo/src/setup.common.ts index 6b09387b..dcb9bdfe 100644 --- a/demo/src/setup.common.ts +++ b/demo/src/setup.common.ts @@ -86,6 +86,8 @@ import getMcpServiceOverride from '@codingame/monaco-vscode-mcp-service-override import getProcessControllerServiceOverride from '@codingame/monaco-vscode-process-explorer-service-override' import getImageResizeServiceOverride from '@codingame/monaco-vscode-image-resize-service-override' import getAssignmentServiceOverride from '@codingame/monaco-vscode-assignment-service-override' +import getGithubServiceOverride from '@codingame/monaco-vscode-github-service-override' +import getMeteredConnectionServiceOverride from '@codingame/monaco-vscode-metered-connection-service-override' import { EnvironmentOverride } from '@codingame/monaco-vscode-api/workbench' import { Worker } from './tools/fakeWorker.js' import defaultKeybindings from './user/keybindings.json?raw' @@ -609,5 +611,7 @@ export const commonServices: IEditorOverrideServices = { ...getMcpServiceOverride(), ...getProcessControllerServiceOverride(), ...getImageResizeServiceOverride(), - ...getAssignmentServiceOverride() + ...getAssignmentServiceOverride(), + ...getGithubServiceOverride(), + ...getMeteredConnectionServiceOverride() } From 1b83bb1ef1fb8160e53f0af6d516c0a13ebe6438 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:31:46 +0200 Subject: [PATCH 16/35] lib(demo): update local dependencies --- demo/package-lock.json | 27 +++++++++++++++++++++++++++ demo/package.json | 25 ++++++++++++++----------- 2 files changed, 41 insertions(+), 11 deletions(-) diff --git a/demo/package-lock.json b/demo/package-lock.json index e600d955..42a3a3e2 100644 --- a/demo/package-lock.json +++ b/demo/package-lock.json @@ -48,6 +48,7 @@ "@codingame/monaco-vscode-fsharp-default-extension": "file:../dist/packages/monaco-vscode-fsharp-default-extension", "@codingame/monaco-vscode-git-base-default-extension": "file:../dist/packages/monaco-vscode-git-base-default-extension", "@codingame/monaco-vscode-github-authentication-default-extension": "file:../dist/packages/monaco-vscode-github-authentication-default-extension", + "@codingame/monaco-vscode-github-service-override": "file:../dist/packages/monaco-vscode-github-service-override", "@codingame/monaco-vscode-go-default-extension": "file:../dist/packages/monaco-vscode-go-default-extension", "@codingame/monaco-vscode-groovy-default-extension": "file:../dist/packages/monaco-vscode-groovy-default-extension", "@codingame/monaco-vscode-handlebars-default-extension": "file:../dist/packages/monaco-vscode-handlebars-default-extension", @@ -100,6 +101,7 @@ "@codingame/monaco-vscode-media-preview-default-extension": "file:../dist/packages/monaco-vscode-media-preview-default-extension", "@codingame/monaco-vscode-merge-conflict-default-extension": "file:../dist/packages/monaco-vscode-merge-conflict-default-extension", "@codingame/monaco-vscode-mermaid-markdown-features-default-extension": "file:../dist/packages/monaco-vscode-mermaid-markdown-features-default-extension", + "@codingame/monaco-vscode-metered-connection-service-override": "file:../dist/packages/monaco-vscode-metered-connection-service-override", "@codingame/monaco-vscode-model-service-override": "file:../dist/packages/monaco-vscode-model-service-override", "@codingame/monaco-vscode-monarch-service-override": "file:../dist/packages/monaco-vscode-monarch-service-override", "@codingame/monaco-vscode-multi-diff-editor-service-override": "file:../dist/packages/monaco-vscode-multi-diff-editor-service-override", @@ -157,6 +159,7 @@ "@codingame/monaco-vscode-theme-abyss-default-extension": "file:../dist/packages/monaco-vscode-theme-abyss-default-extension", "@codingame/monaco-vscode-theme-defaults-default-extension": "file:../dist/packages/monaco-vscode-theme-defaults-default-extension", "@codingame/monaco-vscode-theme-kimbie-dark-default-extension": "file:../dist/packages/monaco-vscode-theme-kimbie-dark-default-extension", + "@codingame/monaco-vscode-theme-modern-icons-default-extension": "file:../dist/packages/monaco-vscode-theme-modern-icons-default-extension", "@codingame/monaco-vscode-theme-monokai-default-extension": "file:../dist/packages/monaco-vscode-theme-monokai-default-extension", "@codingame/monaco-vscode-theme-monokai-dimmed-default-extension": "file:../dist/packages/monaco-vscode-theme-monokai-dimmed-default-extension", "@codingame/monaco-vscode-theme-quietlight-default-extension": "file:../dist/packages/monaco-vscode-theme-quietlight-default-extension", @@ -686,6 +689,14 @@ "@codingame/monaco-vscode-api": "0.0.0-semantic-release" } }, + "node_modules/@codingame/monaco-vscode-github-service-override": { + "version": "0.0.0-semantic-release", + "resolved": "file:../dist/packages/monaco-vscode-github-service-override", + "license": "MIT", + "dependencies": { + "@codingame/monaco-vscode-api": "0.0.0-semantic-release" + } + }, "node_modules/@codingame/monaco-vscode-go-default-extension": { "version": "0.0.0-semantic-release", "resolved": "file:../dist/packages/monaco-vscode-go-default-extension", @@ -1109,6 +1120,14 @@ "@codingame/monaco-vscode-api": "0.0.0-semantic-release" } }, + "node_modules/@codingame/monaco-vscode-metered-connection-service-override": { + "version": "0.0.0-semantic-release", + "resolved": "file:../dist/packages/monaco-vscode-metered-connection-service-override", + "license": "MIT", + "dependencies": { + "@codingame/monaco-vscode-api": "0.0.0-semantic-release" + } + }, "node_modules/@codingame/monaco-vscode-model-service-override": { "version": "0.0.0-semantic-release", "resolved": "file:../dist/packages/monaco-vscode-model-service-override", @@ -1613,6 +1632,14 @@ "@codingame/monaco-vscode-api": "0.0.0-semantic-release" } }, + "node_modules/@codingame/monaco-vscode-theme-modern-icons-default-extension": { + "version": "0.0.0-semantic-release", + "resolved": "file:../dist/packages/monaco-vscode-theme-modern-icons-default-extension", + "license": "MIT", + "dependencies": { + "@codingame/monaco-vscode-api": "0.0.0-semantic-release" + } + }, "node_modules/@codingame/monaco-vscode-theme-monokai-default-extension": { "version": "0.0.0-semantic-release", "resolved": "file:../dist/packages/monaco-vscode-theme-monokai-default-extension", diff --git a/demo/package.json b/demo/package.json index 8708eabe..bef57549 100644 --- a/demo/package.json +++ b/demo/package.json @@ -17,8 +17,6 @@ "preprepare": "patch-package" }, "devDependencies": { - "@codingame/monaco-vscode-rollup-extension-directory-plugin": "file:../dist/packages/monaco-vscode-rollup-extension-directory-plugin", - "@codingame/monaco-vscode-rollup-vsix-plugin": "file:../dist/packages/monaco-vscode-rollup-vsix-plugin", "@types/dockerode": "^4.0.1", "@types/express": "^5.0.6", "@types/node": "^25.9.3", @@ -26,9 +24,15 @@ "@types/ws": "^8.18.1", "oxlint": "^1.83.0", "typescript": "~7.0.2", - "vite": "8.3.0" + "vite": "8.3.0", + "@codingame/monaco-vscode-rollup-extension-directory-plugin": "file:../dist/packages/monaco-vscode-rollup-extension-directory-plugin", + "@codingame/monaco-vscode-rollup-vsix-plugin": "file:../dist/packages/monaco-vscode-rollup-vsix-plugin" }, "dependencies": { + "ansi-colors": "^4.1.3", + "dockerode": "^5.0.1", + "express": "^5.2.1", + "ws": "^8.21.3", "@codingame/monaco-vscode-accessibility-service-override": "file:../dist/packages/monaco-vscode-accessibility-service-override", "@codingame/monaco-vscode-ai-service-override": "file:../dist/packages/monaco-vscode-ai-service-override", "@codingame/monaco-vscode-all-default-extensions": "file:../dist/packages/monaco-vscode-all-default-extensions", @@ -57,11 +61,13 @@ "@codingame/monaco-vscode-docker-default-extension": "file:../dist/packages/monaco-vscode-docker-default-extension", "@codingame/monaco-vscode-dotenv-default-extension": "file:../dist/packages/monaco-vscode-dotenv-default-extension", "@codingame/monaco-vscode-edit-sessions-service-override": "file:../dist/packages/monaco-vscode-edit-sessions-service-override", + "monaco-editor": "file:../dist/packages/monaco-vscode-editor-api", "@codingame/monaco-vscode-editor-service-override": "file:../dist/packages/monaco-vscode-editor-service-override", "@codingame/monaco-vscode-emmet-default-extension": "file:../dist/packages/monaco-vscode-emmet-default-extension", "@codingame/monaco-vscode-emmet-service-override": "file:../dist/packages/monaco-vscode-emmet-service-override", "@codingame/monaco-vscode-environment-service-override": "file:../dist/packages/monaco-vscode-environment-service-override", "@codingame/monaco-vscode-explorer-service-override": "file:../dist/packages/monaco-vscode-explorer-service-override", + "vscode": "file:../dist/packages/monaco-vscode-extension-api", "@codingame/monaco-vscode-extension-editing-default-extension": "file:../dist/packages/monaco-vscode-extension-editing-default-extension", "@codingame/monaco-vscode-extension-gallery-service-override": "file:../dist/packages/monaco-vscode-extension-gallery-service-override", "@codingame/monaco-vscode-extensions-service-override": "file:../dist/packages/monaco-vscode-extensions-service-override", @@ -69,6 +75,7 @@ "@codingame/monaco-vscode-fsharp-default-extension": "file:../dist/packages/monaco-vscode-fsharp-default-extension", "@codingame/monaco-vscode-git-base-default-extension": "file:../dist/packages/monaco-vscode-git-base-default-extension", "@codingame/monaco-vscode-github-authentication-default-extension": "file:../dist/packages/monaco-vscode-github-authentication-default-extension", + "@codingame/monaco-vscode-github-service-override": "file:../dist/packages/monaco-vscode-github-service-override", "@codingame/monaco-vscode-go-default-extension": "file:../dist/packages/monaco-vscode-go-default-extension", "@codingame/monaco-vscode-groovy-default-extension": "file:../dist/packages/monaco-vscode-groovy-default-extension", "@codingame/monaco-vscode-handlebars-default-extension": "file:../dist/packages/monaco-vscode-handlebars-default-extension", @@ -121,6 +128,7 @@ "@codingame/monaco-vscode-media-preview-default-extension": "file:../dist/packages/monaco-vscode-media-preview-default-extension", "@codingame/monaco-vscode-merge-conflict-default-extension": "file:../dist/packages/monaco-vscode-merge-conflict-default-extension", "@codingame/monaco-vscode-mermaid-markdown-features-default-extension": "file:../dist/packages/monaco-vscode-mermaid-markdown-features-default-extension", + "@codingame/monaco-vscode-metered-connection-service-override": "file:../dist/packages/monaco-vscode-metered-connection-service-override", "@codingame/monaco-vscode-model-service-override": "file:../dist/packages/monaco-vscode-model-service-override", "@codingame/monaco-vscode-monarch-service-override": "file:../dist/packages/monaco-vscode-monarch-service-override", "@codingame/monaco-vscode-multi-diff-editor-service-override": "file:../dist/packages/monaco-vscode-multi-diff-editor-service-override", @@ -178,6 +186,7 @@ "@codingame/monaco-vscode-theme-abyss-default-extension": "file:../dist/packages/monaco-vscode-theme-abyss-default-extension", "@codingame/monaco-vscode-theme-defaults-default-extension": "file:../dist/packages/monaco-vscode-theme-defaults-default-extension", "@codingame/monaco-vscode-theme-kimbie-dark-default-extension": "file:../dist/packages/monaco-vscode-theme-kimbie-dark-default-extension", + "@codingame/monaco-vscode-theme-modern-icons-default-extension": "file:../dist/packages/monaco-vscode-theme-modern-icons-default-extension", "@codingame/monaco-vscode-theme-monokai-default-extension": "file:../dist/packages/monaco-vscode-theme-monokai-default-extension", "@codingame/monaco-vscode-theme-monokai-dimmed-default-extension": "file:../dist/packages/monaco-vscode-theme-monokai-dimmed-default-extension", "@codingame/monaco-vscode-theme-quietlight-default-extension": "file:../dist/packages/monaco-vscode-theme-quietlight-default-extension", @@ -208,13 +217,7 @@ "@codingame/monaco-vscode-xml-default-extension": "file:../dist/packages/monaco-vscode-xml-default-extension", "@codingame/monaco-vscode-xterm-addons-common": "file:../dist/packages/monaco-vscode-xterm-addons-common", "@codingame/monaco-vscode-xterm-common": "file:../dist/packages/monaco-vscode-xterm-common", - "@codingame/monaco-vscode-yaml-default-extension": "file:../dist/packages/monaco-vscode-yaml-default-extension", - "ansi-colors": "^4.1.3", - "dockerode": "^5.0.1", - "express": "^5.2.1", - "monaco-editor": "file:../dist/packages/monaco-vscode-editor-api", - "vscode": "file:../dist/packages/monaco-vscode-extension-api", - "ws": "^8.21.3" + "@codingame/monaco-vscode-yaml-default-extension": "file:../dist/packages/monaco-vscode-yaml-default-extension" }, "volta": { "extends": "../package.json" @@ -224,4 +227,4 @@ "protobufjs@7.6.3": true, "ssh2@1.17.0": true } -} +} \ No newline at end of file From 83131fdebd1b6a055be1a232f581942920b9a331 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:53:01 +0200 Subject: [PATCH 17/35] fix: session editor service make no sense --- src/service-override/editor/classic.ts | 183 ++++++++++++++++++++++++- src/service-override/editor/common.ts | 181 ------------------------ src/service-override/editor/session.ts | 24 +--- 3 files changed, 178 insertions(+), 210 deletions(-) delete mode 100644 src/service-override/editor/common.ts diff --git a/src/service-override/editor/classic.ts b/src/service-override/editor/classic.ts index ddb7d6e9..3d7717b9 100644 --- a/src/service-override/editor/classic.ts +++ b/src/service-override/editor/classic.ts @@ -1,15 +1,184 @@ +import { mainWindow } from 'vs/base/browser/window' +import { Event } from 'vs/base/common/event' +import type { IReference } from 'vs/base/common/lifecycle' +import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService.service' +import type { IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService' +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import type { IEditorOptions } from 'vs/platform/editor/common/editor' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' +import { DEFAULT_EDITOR_PART_OPTIONS } from 'vs/workbench/browser/parts/editor/editor' +import 'vs/workbench/browser/parts/editor/editor.contribution._autosave.js' +import 'vs/workbench/contrib/files/browser/fileCommands._save.js' +import 'vs/workbench/contrib/files/browser/files.contribution._fileEditorFactory.js' +import { CodeEditorService } from 'vs/workbench/services/editor/browser/codeEditorService' +import { + GroupOrientation, + type IEditorPart, + type IModalEditorPart +} from 'vs/workbench/services/editor/common/editorGroupsService' +import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService.service' +import { TextEditorService } from 'vs/workbench/services/textfile/common/textEditorService' +import { ITextEditorService } from 'vs/workbench/services/textfile/common/textEditorService.service' +import { unsupported } from '../../tools.js' +import { + MonacoDelegateEditorGroupsService, + MonacoEditorService, + type OpenEditor, + fakeActiveGroup +} from '../tools/editor.js' import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service.js' -import getCommonServiceOverride, { type OpenEditor } from './common.js' -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors.js' -import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices.js' -import { MonacoEditorService } from '../tools/editor.js' import { IDiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService.service.js' import { DiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService.js' -export type { OpenEditor, IEditorOptions, IResolvedTextEditorModel, IReference } from './common.js' + +class EmptyEditorPart implements IEditorPart { + onWillDispose = Event.None + hasMaximizedGroup = () => false + windowId = mainWindow.vscodeWindowId + onDidLayout = Event.None + onDidScroll = Event.None + get contentDimension(): never { + return unsupported() + } + + isReady = true + whenReady = Promise.resolve() + whenRestored = Promise.resolve() + hasRestorableState = false + centerLayout = unsupported + isLayoutCentered = unsupported + enforcePartOptions = unsupported + onDidChangeActiveGroup = Event.None + onDidAddGroup = Event.None + onDidRemoveGroup = Event.None + onDidMoveGroup = Event.None + onDidActivateGroup = Event.None + onDidChangeGroupIndex = Event.None + onDidChangeGroupLocked = Event.None + onDidChangeGroupMaximized = Event.None + activeGroup = fakeActiveGroup + get sideGroup(): never { + return unsupported() + } + + groups = [fakeActiveGroup] + count = 0 + orientation = GroupOrientation.HORIZONTAL + getGroups = () => [] + getGroup = () => undefined + activateGroup = unsupported + getSize = unsupported + setSize = unsupported + arrangeGroups = unsupported + toggleMaximizeGroup = unsupported + toggleExpandGroup = unsupported + applyLayout = unsupported + getLayout = unsupported + setGroupOrientation = unsupported + findGroup = () => undefined + addGroup = unsupported + removeGroup = unsupported + moveGroup = unsupported + mergeGroup = unsupported + mergeAllGroups = unsupported + copyGroup = unsupported + partOptions = DEFAULT_EDITOR_PART_OPTIONS + + onDidChangeEditorPartOptions = Event.None + createEditorDropTarget = unsupported +} + +class EmptyEditorGroupsService implements IEditorGroupsService { + activeModalEditorPart: IModalEditorPart | undefined + getScopedInstantiationService = unsupported + registerContextKeyProvider = unsupported + saveWorkingSet = unsupported + getWorkingSets = unsupported + applyWorkingSet = unsupported + deleteWorkingSet = unsupported + onDidCreateAuxiliaryEditorPart = Event.None + + mainPart = new EmptyEditorPart() + activePart = this.mainPart + parts = [this.mainPart] + + getPart = unsupported + createAuxiliaryEditorPart = unsupported + onDidChangeGroupMaximized = Event.None + toggleMaximizeGroup = unsupported + toggleExpandGroup = unsupported + partOptions = DEFAULT_EDITOR_PART_OPTIONS + + createEditorDropTarget = unsupported + readonly _serviceBrand = undefined + getLayout = unsupported + onDidChangeActiveGroup = Event.None + onDidAddGroup = Event.None + onDidRemoveGroup = Event.None + onDidMoveGroup = Event.None + onDidActivateGroup = Event.None + onDidLayout = Event.None + onDidScroll = Event.None + onDidChangeGroupIndex = Event.None + onDidChangeGroupLocked = Event.None + get contentDimension(): never { + return unsupported() + } + + activeGroup = fakeActiveGroup + get sideGroup(): never { + return unsupported() + } + + groups = [fakeActiveGroup] + count = 0 + orientation = GroupOrientation.HORIZONTAL + isReady = false + whenReady = Promise.resolve() + whenRestored = Promise.resolve() + hasRestorableState = false + getGroups = (): never[] => [] + getGroup = (): undefined => undefined + activateGroup = unsupported + getSize = unsupported + setSize = unsupported + arrangeGroups = unsupported + applyLayout = unsupported + centerLayout = unsupported + isLayoutCentered = (): boolean => false + setGroupOrientation = unsupported + findGroup = (): undefined => undefined + addGroup = unsupported + removeGroup = unsupported + moveGroup = unsupported + mergeGroup = unsupported + mergeAllGroups = unsupported + copyGroup = unsupported + onDidChangeEditorPartOptions = Event.None + enforcePartOptions = unsupported + + createModalEditorPart = unsupported +} + +class MonacoEditorGroupsService extends MonacoDelegateEditorGroupsService { + constructor( + openEditor: OpenEditor, + @IInstantiationService instantiationService: IInstantiationService + ) { + super( + instantiationService.createInstance(EmptyEditorGroupsService), + true, + openEditor, + instantiationService + ) + } +} export default function getServiceOverride(openEditor: OpenEditor): IEditorOverrideServices { return { - ...getCommonServiceOverride(openEditor), + [ICodeEditorService.toString()]: new SyncDescriptor(CodeEditorService, undefined, true), + [ITextEditorService.toString()]: new SyncDescriptor(TextEditorService, [], false), + [IEditorGroupsService.toString()]: new SyncDescriptor(MonacoEditorGroupsService, [openEditor]), [IEditorService.toString()]: new SyncDescriptor( MonacoEditorService, [openEditor, () => false], @@ -19,4 +188,4 @@ export default function getServiceOverride(openEditor: OpenEditor): IEditorOverr } } -export { MonacoEditorService } +export type { IEditorOptions, IReference, IResolvedTextEditorModel, OpenEditor } diff --git a/src/service-override/editor/common.ts b/src/service-override/editor/common.ts deleted file mode 100644 index 3bcb0f23..00000000 --- a/src/service-override/editor/common.ts +++ /dev/null @@ -1,181 +0,0 @@ -import { mainWindow } from 'vs/base/browser/window' -import { Event } from 'vs/base/common/event' -import type { IReference } from 'vs/base/common/lifecycle' -import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService.service' -import type { IResolvedTextEditorModel } from 'vs/editor/common/services/resolverService' -import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' -import type { IEditorOptions } from 'vs/platform/editor/common/editor' -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' -import { DEFAULT_EDITOR_PART_OPTIONS } from 'vs/workbench/browser/parts/editor/editor' -import 'vs/workbench/browser/parts/editor/editor.contribution._autosave.js' -import 'vs/workbench/contrib/files/browser/fileCommands._save.js' -import 'vs/workbench/contrib/files/browser/files.contribution._fileEditorFactory.js' -import { CodeEditorService } from 'vs/workbench/services/editor/browser/codeEditorService' -import { - GroupOrientation, - type IEditorPart, - type IModalEditorPart -} from 'vs/workbench/services/editor/common/editorGroupsService' -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService.service' -import { TextEditorService } from 'vs/workbench/services/textfile/common/textEditorService' -import { ITextEditorService } from 'vs/workbench/services/textfile/common/textEditorService.service' -import { unsupported } from '../../tools.js' -import { - MonacoDelegateEditorGroupsService, - type OpenEditor, - fakeActiveGroup -} from '../tools/editor.js' - -class EmptyEditorPart implements IEditorPart { - onWillDispose = Event.None - hasMaximizedGroup = () => false - windowId = mainWindow.vscodeWindowId - onDidLayout = Event.None - onDidScroll = Event.None - get contentDimension(): never { - return unsupported() - } - - isReady = true - whenReady = Promise.resolve() - whenRestored = Promise.resolve() - hasRestorableState = false - centerLayout = unsupported - isLayoutCentered = unsupported - enforcePartOptions = unsupported - onDidChangeActiveGroup = Event.None - onDidAddGroup = Event.None - onDidRemoveGroup = Event.None - onDidMoveGroup = Event.None - onDidActivateGroup = Event.None - onDidChangeGroupIndex = Event.None - onDidChangeGroupLocked = Event.None - onDidChangeGroupMaximized = Event.None - activeGroup = fakeActiveGroup - get sideGroup(): never { - return unsupported() - } - - groups = [fakeActiveGroup] - count = 0 - orientation = GroupOrientation.HORIZONTAL - getGroups = () => [] - getGroup = () => undefined - activateGroup = unsupported - getSize = unsupported - setSize = unsupported - arrangeGroups = unsupported - toggleMaximizeGroup = unsupported - toggleExpandGroup = unsupported - applyLayout = unsupported - getLayout = unsupported - setGroupOrientation = unsupported - findGroup = () => undefined - addGroup = unsupported - removeGroup = unsupported - moveGroup = unsupported - mergeGroup = unsupported - mergeAllGroups = unsupported - copyGroup = unsupported - partOptions = DEFAULT_EDITOR_PART_OPTIONS - - onDidChangeEditorPartOptions = Event.None - createEditorDropTarget = unsupported -} - -class EmptyEditorGroupsService implements IEditorGroupsService { - activeModalEditorPart: IModalEditorPart | undefined - getScopedInstantiationService = unsupported - registerContextKeyProvider = unsupported - saveWorkingSet = unsupported - getWorkingSets = unsupported - applyWorkingSet = unsupported - deleteWorkingSet = unsupported - onDidCreateAuxiliaryEditorPart = Event.None - - mainPart = new EmptyEditorPart() - activePart = this.mainPart - parts = [this.mainPart] - - getPart = unsupported - createAuxiliaryEditorPart = unsupported - onDidChangeGroupMaximized = Event.None - toggleMaximizeGroup = unsupported - toggleExpandGroup = unsupported - partOptions = DEFAULT_EDITOR_PART_OPTIONS - - createEditorDropTarget = unsupported - readonly _serviceBrand = undefined - getLayout = unsupported - onDidChangeActiveGroup = Event.None - onDidAddGroup = Event.None - onDidRemoveGroup = Event.None - onDidMoveGroup = Event.None - onDidActivateGroup = Event.None - onDidLayout = Event.None - onDidScroll = Event.None - onDidChangeGroupIndex = Event.None - onDidChangeGroupLocked = Event.None - get contentDimension(): never { - return unsupported() - } - - activeGroup = fakeActiveGroup - get sideGroup(): never { - return unsupported() - } - - groups = [fakeActiveGroup] - count = 0 - orientation = GroupOrientation.HORIZONTAL - isReady = false - whenReady = Promise.resolve() - whenRestored = Promise.resolve() - hasRestorableState = false - getGroups = (): never[] => [] - getGroup = (): undefined => undefined - activateGroup = unsupported - getSize = unsupported - setSize = unsupported - arrangeGroups = unsupported - applyLayout = unsupported - centerLayout = unsupported - isLayoutCentered = (): boolean => false - setGroupOrientation = unsupported - findGroup = (): undefined => undefined - addGroup = unsupported - removeGroup = unsupported - moveGroup = unsupported - mergeGroup = unsupported - mergeAllGroups = unsupported - copyGroup = unsupported - onDidChangeEditorPartOptions = Event.None - enforcePartOptions = unsupported - - createModalEditorPart = unsupported -} - -class MonacoEditorGroupsService extends MonacoDelegateEditorGroupsService { - constructor( - openEditor: OpenEditor, - @IInstantiationService instantiationService: IInstantiationService - ) { - super( - instantiationService.createInstance(EmptyEditorGroupsService), - true, - openEditor, - instantiationService - ) - } -} - -export default function getServiceOverride(openEditor: OpenEditor): IEditorOverrideServices { - return { - [ICodeEditorService.toString()]: new SyncDescriptor(CodeEditorService, undefined, true), - [ITextEditorService.toString()]: new SyncDescriptor(TextEditorService, [], false), - [IEditorGroupsService.toString()]: new SyncDescriptor(MonacoEditorGroupsService, [openEditor]) - } -} - -export type { IEditorOptions, IReference, IResolvedTextEditorModel, OpenEditor } diff --git a/src/service-override/editor/session.ts b/src/service-override/editor/session.ts index b223e33c..195f31ca 100644 --- a/src/service-override/editor/session.ts +++ b/src/service-override/editor/session.ts @@ -1,23 +1,3 @@ -import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service.js' -import getCommonServiceOverride, { type OpenEditor } from './common.js' -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors.js' -import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices.js' -import { MonacoEditorService } from '../tools/editor.js' -import { EditorParts } from 'vs/sessions/browser/parts/editorParts.js' -import { IDiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService.service.js' -import { SessionsDiffEditorCommandsService } from 'vs/sessions/contrib/editor/browser/diffEditor.sessions.contribution.js' -export type { OpenEditor, IEditorOptions, IResolvedTextEditorModel, IReference } from './common.js' +throw new Error('Editor service override cannot be used in session mode') -export default function getServiceOverride(openEditor: OpenEditor): IEditorOverrideServices { - return { - ...getCommonServiceOverride(openEditor), - [IEditorService.toString()]: new SyncDescriptor(EditorParts, [], true), - [IDiffEditorCommandsService.toString()]: new SyncDescriptor( - SessionsDiffEditorCommandsService, - [], - true - ) - } -} - -export { MonacoEditorService } +export {} From 84c533fcc6ba452ec251f3ce35b440069c1e450c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 14:53:35 +0200 Subject: [PATCH 18/35] fix: missing or misplaced editor services --- src/service-override/viewCommon/classic.ts | 12 +++++++++++- src/service-override/viewCommon/session.ts | 12 +++++++++++- src/service-override/workbench/common.ts | 6 +----- 3 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/service-override/viewCommon/classic.ts b/src/service-override/viewCommon/classic.ts index 34981349..2156c3a3 100644 --- a/src/service-override/viewCommon/classic.ts +++ b/src/service-override/viewCommon/classic.ts @@ -3,13 +3,23 @@ import getCommonServiceOverride from './common' import { PaneCompositePartService } from 'vs/workbench/browser/parts/paneCompositePartService' import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite.service' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { IDiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService.service' +import { DiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService' import 'vs/workbench/contrib/modernUI/browser/modernUI.contribution' +import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service' +import { EditorService } from 'vs/workbench/services/editor/browser/editorService' export default function getServiceOverride( _webviewIframeAlternateDomains?: string ): IEditorOverrideServices { return { ...getCommonServiceOverride(_webviewIframeAlternateDomains), - [IPaneCompositePartService.toString()]: new SyncDescriptor(PaneCompositePartService, [], true) + [IPaneCompositePartService.toString()]: new SyncDescriptor(PaneCompositePartService, [], true), + [IDiffEditorCommandsService.toString()]: new SyncDescriptor( + DiffEditorCommandsService, + [], + true + ), + [IEditorService.toString()]: new SyncDescriptor(EditorService, [undefined], false) } } diff --git a/src/service-override/viewCommon/session.ts b/src/service-override/viewCommon/session.ts index a8e5f20d..cf871d17 100644 --- a/src/service-override/viewCommon/session.ts +++ b/src/service-override/viewCommon/session.ts @@ -3,6 +3,10 @@ import getCommonServiceOverride from './common' import { AgenticPaneCompositePartService } from 'vs/sessions/browser/paneCompositePartService' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite.service' +import { IDiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService.service' +import { SessionsDiffEditorCommandsService } from 'vs/sessions/contrib/editor/browser/diffEditor.sessions.contribution' +import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service' +import { EditorParts } from 'vs/sessions/browser/parts/editorParts' export default function getServiceOverride( _webviewIframeAlternateDomains?: string @@ -13,6 +17,12 @@ export default function getServiceOverride( AgenticPaneCompositePartService, [], true - ) + ), + [IDiffEditorCommandsService.toString()]: new SyncDescriptor( + SessionsDiffEditorCommandsService, + [], + true + ), + [IEditorService.toString()]: new SyncDescriptor(EditorParts, [], true) } } diff --git a/src/service-override/workbench/common.ts b/src/service-override/workbench/common.ts index c72e38c2..04cf20c8 100644 --- a/src/service-override/workbench/common.ts +++ b/src/service-override/workbench/common.ts @@ -1,9 +1,6 @@ import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import getQuickAccessOverride from '../quickaccess' import getKeybindingsOverride from '../keybindings' -import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service' -import { EditorService } from 'vs/workbench/services/editor/browser/editorService' -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' export default function getServiceOverride(): IEditorOverrideServices { return { @@ -13,7 +10,6 @@ export default function getServiceOverride(): IEditorOverrideServices { }), ...getKeybindingsOverride({ shouldUseGlobalKeybindings: () => true - }), - [IEditorService.toString()]: new SyncDescriptor(EditorService, [undefined], false) + }) } } From 388c50dfa7191c218ff11b09433bfebbef84c7a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 21 Sep 2026 16:44:57 +0200 Subject: [PATCH 19/35] feat: also expose service-override common module --- rollup/rollup.config.ts | 2 +- rollup/tools/configuredSubpackagePlugin.ts | 25 +++++++++++++++++++--- 2 files changed, 23 insertions(+), 4 deletions(-) diff --git a/rollup/rollup.config.ts b/rollup/rollup.config.ts index 807a4b45..2ad0e39e 100644 --- a/rollup/rollup.config.ts +++ b/rollup/rollup.config.ts @@ -43,7 +43,7 @@ const serviceOverrideEntries = fs return [entry.name] } if (entry.isDirectory()) { - return ['classic.ts', 'session.ts'] + return ['classic.ts', 'session.ts', 'common.ts'] .map((name) => nodePath.join(entry.name, name)) .filter((name) => fs.existsSync(nodePath.resolve(serviceOverrideDir, name))) } diff --git a/rollup/tools/configuredSubpackagePlugin.ts b/rollup/tools/configuredSubpackagePlugin.ts index 816cddfa..7a021860 100644 --- a/rollup/tools/configuredSubpackagePlugin.ts +++ b/rollup/tools/configuredSubpackagePlugin.ts @@ -350,6 +350,9 @@ ${code}` const sessionEntryPoint = serviceOverrideEntryPoints.find( (e) => nodePath.basename(e) === 'session.js' ) + const commonEntryPoint = serviceOverrideEntryPoints.find( + (e) => nodePath.basename(e) === 'common.js' + ) const workerEntryPoint = (rollupOptions.input as string[]).find((e) => e.includes('/workers/') ) @@ -363,6 +366,12 @@ ${code}` 'session.d': sessionEntryPoint.replace(/\.js$/, '.d.ts') } : {}), + ...(commonEntryPoint != null + ? { + common: commonEntryPoint, + 'common.d': commonEntryPoint.replace(/\.js$/, '.d.ts') + } + : {}), ...(workerEntryPoint != null ? { worker: workerEntryPoint @@ -376,15 +385,17 @@ ${code}` getInterPackageImport(path, groupSetName) { const packageName = groupSetName.alias ?? groupSetName.name const normalizedPath = path.split(nodePath.sep).join('/') - const nestedServiceOverride = /^service-override\/[^/]+\/(classic|session)\.(js|d\.ts)$/.exec( - normalizedPath - ) + const nestedServiceOverride = + /^service-override\/[^/]+\/(classic|session|common)\.(js|d\.ts)$/.exec(normalizedPath) if (nestedServiceOverride?.[1] === 'classic') { return packageName } if (nestedServiceOverride?.[1] === 'session') { return `${packageName}/session` } + if (nestedServiceOverride?.[1] === 'common') { + return `${packageName}/common` + } if (/^service-override\/[^/]+\.(js|d\.ts)$/.exec(normalizedPath) != null) { // reference the package entrypoint return packageName @@ -579,6 +590,14 @@ ${code}` } } : {}), + ...(entrypoints.has('common.js') + ? { + './common': { + types: './common.d.ts', + default: './common.js' + } + } + : {}), './*': { types: './*.d.ts', default: './*.js' From 196c85c560225653b758c47bdfec5b02b208b971 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 28 Sep 2026 12:36:28 +0200 Subject: [PATCH 20/35] fix: stop marking "map" calls are pure it's everywhere in the VSCode code base --- rollup/tools/vscode.ts | 1 - ...-only-apply-style-on-specific-class.patch} | 0 .../0020-fix-replace-map-by-forEach.patch | 36 ------------------- ...ileAccess.asBrowserUri-at-the-root-.patch} | 0 ...nup-remove-some-checks-and-warnings.patch} | 0 ...h => 0023-refactor-split-class-in-2.patch} | 0 ...supported-as-soon-as-there-is-a-reg.patch} | 0 ...-use-asBrowserUri-to-get-iframe-src.patch} | 0 ...d-some-parameter-to-webview-iframes.patch} | 0 ...tect-fullscreen-if-it-s-not-a-guess.patch} | 0 ...tch => 0028-fix-only-use-open-model.patch} | 0 ...equire-by-FileAccess.toModuleConten.patch} | 0 ...a-local-folder-even-when-there-is-a.patch} | 0 ...to-switch-storage-service-workspace.patch} | 0 ...ove-code-that-we-will-run-ourselves.patch} | 0 ...e-import-function-able-to-replace-i.patch} | 0 ...-detect-if-localization-were-alread.patch} | 0 ...n-from-service-file-to-contribution.patch} | 0 ...factor-split-workbench-contribution.patch} | 0 ...r-split-service-and-extension-point.patch} | 0 ...ntax.patch => 0038-fix-weird-syntax.patch} | 0 ...-stuff-from-web-workbench-or-the-ty.patch} | 0 ...-that-language-service-refactor-doe.patch} | 0 ...tool-to-extract-service-identifiers.patch} | 0 ...de-to-be-able-to-import-only-requir.patch} | 0 ...fix-just-use-regular-dynamic-import.patch} | 0 ...-data-urls-in-extension-host-worker.patch} | 0 ...45-fix-stop-expecting-a-git-context.patch} | 0 ...ract-constants-into-separate-module.patch} | 0 ...iveChatController-in-another-module.patch} | 0 ...feat-add-transformConstEnums-script.patch} | 0 ...porting-class-just-to-check-intance.patch} | 0 ...syntax-prevent-importing-amdX-at-al.patch} | 0 ...-support-configuring-worker-options.patch} | 0 ...> 0052-fix-always-set-parent-origin.patch} | 0 ...style-to-help-extractService-script.patch} | 0 ...ird-type-reference-to-fix-the-build.patch} | 0 ...=> 0055-fix-break-cyclic-dependency.patch} | 0 ...-tree-sitter-wasm-until-MS-fixes-it.patch} | 0 ...-task-that-only-export-editor-types.patch} | 0 ...xy-from-being-detected-as-a-promise.patch} | 0 ...tch => 0059-feat-support-shadow-dom.patch} | 24 ++++++++++++- ...-adoptedStyleSheets-for-aux-windows.patch} | 0 ...x-prevent-NPE-when-using-shadow-dom.patch} | 0 ...t-key-to-enable-further-customizati.patch} | 0 ...=> 0063-fix-break-cyclic-dependency.patch} | 0 ...feat-allow-to-override-product-icon.patch} | 0 ...from-entering-fullscreen-if-not-occ.patch} | 0 ...support-loading-VSCode-in-an-iframe.patch} | 0 ...s-created-outside-of-the-VSCode-con.patch} | 0 ...lement-creation-to-be-able-to-creat.patch} | 12 +++---- ...ry-window-when-the-context-is-unloa.patch} | 0 ...ctor-make-editors-register-themself.patch} | 0 ...o-register-the-quickinput-container.patch} | 0 ...=> 0072-refactor-split-contribution.patch} | 0 ...tional-as-sometime-openvsix-doesn-t.patch} | 0 ...IExtensionResourceLoaderService-ins.patch} | 0 ...> 0075-feat-add-customEditorRestore.patch} | 0 ...atch => 0076-fix-fix-focus-conflict.patch} | 0 ...-shouldAttemptTaskReconnection-flag.patch} | 0 ...layout-message-before-actual-view-l.patch} | 0 ...iguration-editing-built-in-extensio.patch} | 0 ...ode-to-be-able-to-override-behavior.patch} | 0 ...reencast-mode-mouse-marker-position.patch} | 0 ...082-fix-make-product-field-optional.patch} | 0 ...matic-code-causing-issues-with-webp.patch} | 0 ...t-support-disabling-view-containers.patch} | 0 ....integrated.preserveDrawingBuffer-s.patch} | 0 ...ort-chat-related-stuff-from-chat-co.patch} | 0 ...tor-extract-storage-creation-method.patch} | 0 ...eat-allow-defining-the-workspace-id.patch} | 0 ...-do-not-hide-copilot-ui-on-web-mode.patch} | 0 ... => 0090-feat-add-AIDisabled-policy.patch} | 0 ...bling-specific-extension-from-workb.patch} | 0 ...ix-chat-always-update-auxiliary-bar.patch} | 0 ...he-sidebar-forcefully-if-the-settin.patch} | 0 ...port.patch => 0094-fix-dedup-import.patch} | 0 ... => 0095-fix-workaround-firefox-bug.patch} | 0 ...ch => 0096-fix-remove-unused-import.patch} | 0 ...ix-remove-webview-hash-verification.patch} | 0 ...efault-view-container-may-not-exist.patch} | 0 ...configuration-scope-rely-on-the-has.patch} | 0 ...s-check-that-prevents-ai-assist-fro.patch} | 0 ...1-refactor-move-interface-in-common.patch} | 0 ...code-infra-specific-security-checks.patch} | 0 ...y-and-split-mermaid-webview-scripts.patch} | 0 ...g-a-unique-subdomain-for-the-extHos.patch} | 0 ...05-fix-stop-disabling-browser-cache.patch} | 0 ...vent-generating-invalid-iframe-urls.patch} | 0 ...fix-prevent-floating-error-promises.patch} | 0 90 files changed, 29 insertions(+), 44 deletions(-) rename vscode-patches/{0021-feat-only-apply-style-on-specific-class.patch => 0020-feat-only-apply-style-on-specific-class.patch} (100%) delete mode 100644 vscode-patches/0020-fix-replace-map-by-forEach.patch rename vscode-patches/{0022-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch => 0021-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch} (100%) rename vscode-patches/{0023-cleanup-remove-some-checks-and-warnings.patch => 0022-cleanup-remove-some-checks-and-warnings.patch} (100%) rename vscode-patches/{0024-refactor-split-class-in-2.patch => 0023-refactor-split-class-in-2.patch} (100%) rename vscode-patches/{0025-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch => 0024-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch} (100%) rename vscode-patches/{0026-fix-use-asBrowserUri-to-get-iframe-src.patch => 0025-fix-use-asBrowserUri-to-get-iframe-src.patch} (100%) rename vscode-patches/{0027-feat-add-some-parameter-to-webview-iframes.patch => 0026-feat-add-some-parameter-to-webview-iframes.patch} (100%) rename vscode-patches/{0028-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch => 0027-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch} (100%) rename vscode-patches/{0029-fix-only-use-open-model.patch => 0028-fix-only-use-open-model.patch} (100%) rename vscode-patches/{0030-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch => 0029-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch} (100%) rename vscode-patches/{0031-fix-allow-adding-a-local-folder-even-when-there-is-a.patch => 0030-fix-allow-adding-a-local-folder-even-when-there-is-a.patch} (100%) rename vscode-patches/{0032-feat-allow-to-switch-storage-service-workspace.patch => 0031-feat-allow-to-switch-storage-service-workspace.patch} (100%) rename vscode-patches/{0033-cleanup-remove-code-that-we-will-run-ourselves.patch => 0032-cleanup-remove-code-that-we-will-run-ourselves.patch} (100%) rename vscode-patches/{0034-fix-typescript-use-import-function-able-to-replace-i.patch => 0033-fix-typescript-use-import-function-able-to-replace-i.patch} (100%) rename vscode-patches/{0035-feat-add-a-way-to-detect-if-localization-were-alread.patch => 0034-feat-add-a-way-to-detect-if-localization-were-alread.patch} (100%) rename vscode-patches/{0036-fix-move-action-from-service-file-to-contribution.patch => 0035-fix-move-action-from-service-file-to-contribution.patch} (100%) rename vscode-patches/{0037-refactor-split-workbench-contribution.patch => 0036-refactor-split-workbench-contribution.patch} (100%) rename vscode-patches/{0038-refactor-split-service-and-extension-point.patch => 0037-refactor-split-service-and-extension-point.patch} (100%) rename vscode-patches/{0039-fix-weird-syntax.patch => 0038-fix-weird-syntax.patch} (100%) rename vscode-patches/{0040-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch => 0039-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch} (100%) rename vscode-patches/{0041-fix-change-syntax-that-language-service-refactor-doe.patch => 0040-fix-change-syntax-that-language-service-refactor-doe.patch} (100%) rename vscode-patches/{0042-feat-add-build-tool-to-extract-service-identifiers.patch => 0041-feat-add-build-tool-to-extract-service-identifiers.patch} (100%) rename vscode-patches/{0043-refactor-split-code-to-be-able-to-import-only-requir.patch => 0042-refactor-split-code-to-be-able-to-import-only-requir.patch} (100%) rename vscode-patches/{0044-fix-just-use-regular-dynamic-import.patch => 0043-fix-just-use-regular-dynamic-import.patch} (100%) rename vscode-patches/{0045-fix-allow-data-urls-in-extension-host-worker.patch => 0044-fix-allow-data-urls-in-extension-host-worker.patch} (100%) rename vscode-patches/{0046-fix-stop-expecting-a-git-context.patch => 0045-fix-stop-expecting-a-git-context.patch} (100%) rename vscode-patches/{0047-fix-extract-constants-into-separate-module.patch => 0046-fix-extract-constants-into-separate-module.patch} (100%) rename vscode-patches/{0048-fix-store-activeChatController-in-another-module.patch => 0047-fix-store-activeChatController-in-another-module.patch} (100%) rename vscode-patches/{0049-feat-add-transformConstEnums-script.patch => 0048-feat-add-transformConstEnums-script.patch} (100%) rename vscode-patches/{0050-fix-prevent-importing-class-just-to-check-intance.patch => 0049-fix-prevent-importing-class-just-to-check-intance.patch} (100%) rename vscode-patches/{0051-refactor-use-URL-syntax-prevent-importing-amdX-at-al.patch => 0050-refactor-use-URL-syntax-prevent-importing-amdX-at-al.patch} (100%) rename vscode-patches/{0052-feat-support-configuring-worker-options.patch => 0051-feat-support-configuring-worker-options.patch} (100%) rename vscode-patches/{0053-fix-always-set-parent-origin.patch => 0052-fix-always-set-parent-origin.patch} (100%) rename vscode-patches/{0054-fix-change-imort-style-to-help-extractService-script.patch => 0053-fix-change-imort-style-to-help-extractService-script.patch} (100%) rename vscode-patches/{0055-fix-remove-weird-type-reference-to-fix-the-build.patch => 0054-fix-remove-weird-type-reference-to-fix-the-build.patch} (100%) rename vscode-patches/{0056-fix-break-cyclic-dependency.patch => 0055-fix-break-cyclic-dependency.patch} (100%) rename vscode-patches/{0057-fix-ignore-vscode-tree-sitter-wasm-until-MS-fixes-it.patch => 0056-fix-ignore-vscode-tree-sitter-wasm-until-MS-fixes-it.patch} (100%) rename vscode-patches/{0058-feat-add-new-task-that-only-export-editor-types.patch => 0057-feat-add-new-task-that-only-export-editor-types.patch} (100%) rename vscode-patches/{0059-fix-prevent-proxy-from-being-detected-as-a-promise.patch => 0058-fix-prevent-proxy-from-being-detected-as-a-promise.patch} (100%) rename vscode-patches/{0060-feat-support-shadow-dom.patch => 0059-feat-support-shadow-dom.patch} (98%) rename vscode-patches/{0061-feat-support-adoptedStyleSheets-for-aux-windows.patch => 0060-feat-support-adoptedStyleSheets-for-aux-windows.patch} (100%) rename vscode-patches/{0062-fix-prevent-NPE-when-using-shadow-dom.patch => 0061-fix-prevent-NPE-when-using-shadow-dom.patch} (100%) rename vscode-patches/{0063-feat-add-a-context-key-to-enable-further-customizati.patch => 0062-feat-add-a-context-key-to-enable-further-customizati.patch} (100%) rename vscode-patches/{0064-fix-break-cyclic-dependency.patch => 0063-fix-break-cyclic-dependency.patch} (100%) rename vscode-patches/{0065-feat-allow-to-override-product-icon.patch => 0064-feat-allow-to-override-product-icon.patch} (100%) rename vscode-patches/{0066-feat-prevent-IDE-from-entering-fullscreen-if-not-occ.patch => 0065-feat-prevent-IDE-from-entering-fullscreen-if-not-occ.patch} (100%) rename vscode-patches/{0067-feat-support-loading-VSCode-in-an-iframe.patch => 0066-feat-support-loading-VSCode-in-an-iframe.patch} (100%) rename vscode-patches/{0068-feat-mark-elements-created-outside-of-the-VSCode-con.patch => 0067-feat-mark-elements-created-outside-of-the-VSCode-con.patch} (100%) rename vscode-patches/{0069-feat-centralize-element-creation-to-be-able-to-creat.patch => 0068-feat-centralize-element-creation-to-be-able-to-creat.patch} (99%) rename vscode-patches/{0070-fix-close-auxiliary-window-when-the-context-is-unloa.patch => 0069-fix-close-auxiliary-window-when-the-context-is-unloa.patch} (100%) rename vscode-patches/{0071-refactor-make-editors-register-themself.patch => 0070-refactor-make-editors-register-themself.patch} (100%) rename vscode-patches/{0072-fix-also-register-the-quickinput-container.patch => 0071-fix-also-register-the-quickinput-container.patch} (100%) rename vscode-patches/{0073-refactor-split-contribution.patch => 0072-refactor-split-contribution.patch} (100%) rename vscode-patches/{0074-fix-make-field-optional-as-sometime-openvsix-doesn-t.patch => 0073-fix-make-field-optional-as-sometime-openvsix-doesn-t.patch} (100%) rename vscode-patches/{0075-fix-properly-use-IExtensionResourceLoaderService-ins.patch => 0074-fix-properly-use-IExtensionResourceLoaderService-ins.patch} (100%) rename vscode-patches/{0076-feat-add-customEditorRestore.patch => 0075-feat-add-customEditorRestore.patch} (100%) rename vscode-patches/{0077-fix-fix-focus-conflict.patch => 0076-fix-fix-focus-conflict.patch} (100%) rename vscode-patches/{0078-refactor-extract-shouldAttemptTaskReconnection-flag.patch => 0077-refactor-extract-shouldAttemptTaskReconnection-flag.patch} (100%) rename vscode-patches/{0079-fix-remove-empty-layout-message-before-actual-view-l.patch => 0078-fix-remove-empty-layout-message-before-actual-view-l.patch} (100%) rename vscode-patches/{0080-fix-backport-configuration-editing-built-in-extensio.patch => 0079-fix-backport-configuration-editing-built-in-extensio.patch} (100%) rename vscode-patches/{0081-refactor-split-code-to-be-able-to-override-behavior.patch => 0080-refactor-split-code-to-be-able-to-override-behavior.patch} (100%) rename vscode-patches/{0082-fix-fix-screencast-mode-mouse-marker-position.patch => 0081-fix-fix-screencast-mode-mouse-marker-position.patch} (100%) rename vscode-patches/{0083-fix-make-product-field-optional.patch => 0082-fix-make-product-field-optional.patch} (100%) rename vscode-patches/{0084-fix-remove-problematic-code-causing-issues-with-webp.patch => 0083-fix-remove-problematic-code-causing-issues-with-webp.patch} (100%) rename vscode-patches/{0085-feat-support-disabling-view-containers.patch => 0084-feat-support-disabling-view-containers.patch} (100%) rename vscode-patches/{0086-feat-add-terminal.integrated.preserveDrawingBuffer-s.patch => 0085-feat-add-terminal.integrated.preserveDrawingBuffer-s.patch} (100%) rename vscode-patches/{0087-refactor-only-import-chat-related-stuff-from-chat-co.patch => 0086-refactor-only-import-chat-related-stuff-from-chat-co.patch} (100%) rename vscode-patches/{0088-refactor-extract-storage-creation-method.patch => 0087-refactor-extract-storage-creation-method.patch} (100%) rename vscode-patches/{0089-feat-allow-defining-the-workspace-id.patch => 0088-feat-allow-defining-the-workspace-id.patch} (100%) rename vscode-patches/{0090-fix-do-not-hide-copilot-ui-on-web-mode.patch => 0089-fix-do-not-hide-copilot-ui-on-web-mode.patch} (100%) rename vscode-patches/{0091-feat-add-AIDisabled-policy.patch => 0090-feat-add-AIDisabled-policy.patch} (100%) rename vscode-patches/{0092-feat-support-disabling-specific-extension-from-workb.patch => 0091-feat-support-disabling-specific-extension-from-workb.patch} (100%) rename vscode-patches/{0093-fix-chat-always-update-auxiliary-bar.patch => 0092-fix-chat-always-update-auxiliary-bar.patch} (100%) rename vscode-patches/{0094-fix-do-not-hide-the-sidebar-forcefully-if-the-settin.patch => 0093-fix-do-not-hide-the-sidebar-forcefully-if-the-settin.patch} (100%) rename vscode-patches/{0095-fix-dedup-import.patch => 0094-fix-dedup-import.patch} (100%) rename vscode-patches/{0096-fix-workaround-firefox-bug.patch => 0095-fix-workaround-firefox-bug.patch} (100%) rename vscode-patches/{0097-fix-remove-unused-import.patch => 0096-fix-remove-unused-import.patch} (100%) rename vscode-patches/{0098-fix-remove-webview-hash-verification.patch => 0097-fix-remove-webview-hash-verification.patch} (100%) rename vscode-patches/{0099-fix-default-view-container-may-not-exist.patch => 0098-fix-default-view-container-may-not-exist.patch} (100%) rename vscode-patches/{0100-fix-make-default-configuration-scope-rely-on-the-has.patch => 0099-fix-make-default-configuration-scope-rely-on-the-has.patch} (100%) rename vscode-patches/{0101-fix-remove-useless-check-that-prevents-ai-assist-fro.patch => 0100-fix-remove-useless-check-that-prevents-ai-assist-fro.patch} (100%) rename vscode-patches/{0102-refactor-move-interface-in-common.patch => 0101-refactor-move-interface-in-common.patch} (100%) rename vscode-patches/{0103-fix-remove-vscode-infra-specific-security-checks.patch => 0102-fix-remove-vscode-infra-specific-security-checks.patch} (100%) rename vscode-patches/{0104-fix-minify-and-split-mermaid-webview-scripts.patch => 0103-fix-minify-and-split-mermaid-webview-scripts.patch} (100%) rename vscode-patches/{0105-feat-support-using-a-unique-subdomain-for-the-extHos.patch => 0104-feat-support-using-a-unique-subdomain-for-the-extHos.patch} (100%) rename vscode-patches/{0106-fix-stop-disabling-browser-cache.patch => 0105-fix-stop-disabling-browser-cache.patch} (100%) rename vscode-patches/{0107-fix-prevent-generating-invalid-iframe-urls.patch => 0106-fix-prevent-generating-invalid-iframe-urls.patch} (100%) rename vscode-patches/{0108-fix-prevent-floating-error-promises.patch => 0107-fix-prevent-floating-error-promises.patch} (100%) diff --git a/rollup/tools/vscode.ts b/rollup/tools/vscode.ts index 622fc3ac..d10ce942 100644 --- a/rollup/tools/vscode.ts +++ b/rollup/tools/vscode.ts @@ -46,7 +46,6 @@ const PURE_FUNCTIONS = new Set([ 'isEqualTo', 'SyncDescriptor', 'getProxy', - 'map', 'some', 'asFileUri', 'has', diff --git a/vscode-patches/0021-feat-only-apply-style-on-specific-class.patch b/vscode-patches/0020-feat-only-apply-style-on-specific-class.patch similarity index 100% rename from vscode-patches/0021-feat-only-apply-style-on-specific-class.patch rename to vscode-patches/0020-feat-only-apply-style-on-specific-class.patch diff --git a/vscode-patches/0020-fix-replace-map-by-forEach.patch b/vscode-patches/0020-fix-replace-map-by-forEach.patch deleted file mode 100644 index 1ed953c1..00000000 --- a/vscode-patches/0020-fix-replace-map-by-forEach.patch +++ /dev/null @@ -1,36 +0,0 @@ -From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Mon, 11 Mar 2024 17:50:13 +0100 -Subject: [PATCH] fix: replace map by forEach - ---- - src/vs/workbench/browser/parts/compositeBar.ts | 2 +- - src/vs/workbench/browser/parts/views/viewPaneContainer.ts | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/vs/workbench/browser/parts/compositeBar.ts b/src/vs/workbench/browser/parts/compositeBar.ts -index 8d1020b6621..97ffa755b24 100644 ---- a/src/vs/workbench/browser/parts/compositeBar.ts -+++ b/src/vs/workbench/browser/parts/compositeBar.ts -@@ -509,7 +509,7 @@ export class CompositeBar extends Widget implements ICompositeBar { - // Compute sizes only if visible. Otherwise the size measurment would be computed wrongly. - const currentItemsLength = compositeSwitcherBar.viewItems.length; - compositeSwitcherBar.push(items.map(composite => composite.activityAction)); -- items.map((composite, index) => this.compositeSizeInBar.set(composite.id, this.options.orientation === ActionsOrientation.VERTICAL -+ items.forEach((composite, index) => this.compositeSizeInBar.set(composite.id, this.options.orientation === ActionsOrientation.VERTICAL - ? compositeSwitcherBar.getHeight(currentItemsLength + index) - : compositeSwitcherBar.getWidth(currentItemsLength + index) - )); -diff --git a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts -index 552fe08c2b0..d1896cda3ca 100644 ---- a/src/vs/workbench/browser/parts/views/viewPaneContainer.ts -+++ b/src/vs/workbench/browser/parts/views/viewPaneContainer.ts -@@ -684,7 +684,7 @@ export class ViewPaneContainer extends Comp - } - - this.panes.filter(view => view.isVisible() !== visible) -- .map((view) => view.setVisible(visible)); -+ .forEach((view) => view.setVisible(visible)); - } - - isVisible(): boolean { diff --git a/vscode-patches/0022-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch b/vscode-patches/0021-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch similarity index 100% rename from vscode-patches/0022-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch rename to vscode-patches/0021-fix-do-not-call-FileAccess.asBrowserUri-at-the-root-.patch diff --git a/vscode-patches/0023-cleanup-remove-some-checks-and-warnings.patch b/vscode-patches/0022-cleanup-remove-some-checks-and-warnings.patch similarity index 100% rename from vscode-patches/0023-cleanup-remove-some-checks-and-warnings.patch rename to vscode-patches/0022-cleanup-remove-some-checks-and-warnings.patch diff --git a/vscode-patches/0024-refactor-split-class-in-2.patch b/vscode-patches/0023-refactor-split-class-in-2.patch similarity index 100% rename from vscode-patches/0024-refactor-split-class-in-2.patch rename to vscode-patches/0023-refactor-split-class-in-2.patch diff --git a/vscode-patches/0025-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch b/vscode-patches/0024-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch similarity index 100% rename from vscode-patches/0025-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch rename to vscode-patches/0024-fix-mark-process-supported-as-soon-as-there-is-a-reg.patch diff --git a/vscode-patches/0026-fix-use-asBrowserUri-to-get-iframe-src.patch b/vscode-patches/0025-fix-use-asBrowserUri-to-get-iframe-src.patch similarity index 100% rename from vscode-patches/0026-fix-use-asBrowserUri-to-get-iframe-src.patch rename to vscode-patches/0025-fix-use-asBrowserUri-to-get-iframe-src.patch diff --git a/vscode-patches/0027-feat-add-some-parameter-to-webview-iframes.patch b/vscode-patches/0026-feat-add-some-parameter-to-webview-iframes.patch similarity index 100% rename from vscode-patches/0027-feat-add-some-parameter-to-webview-iframes.patch rename to vscode-patches/0026-feat-add-some-parameter-to-webview-iframes.patch diff --git a/vscode-patches/0028-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch b/vscode-patches/0027-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch similarity index 100% rename from vscode-patches/0028-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch rename to vscode-patches/0027-fix-only-detect-fullscreen-if-it-s-not-a-guess.patch diff --git a/vscode-patches/0029-fix-only-use-open-model.patch b/vscode-patches/0028-fix-only-use-open-model.patch similarity index 100% rename from vscode-patches/0029-fix-only-use-open-model.patch rename to vscode-patches/0028-fix-only-use-open-model.patch diff --git a/vscode-patches/0030-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch b/vscode-patches/0029-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch similarity index 100% rename from vscode-patches/0030-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch rename to vscode-patches/0029-fix-replace-CJS-require-by-FileAccess.toModuleConten.patch diff --git a/vscode-patches/0031-fix-allow-adding-a-local-folder-even-when-there-is-a.patch b/vscode-patches/0030-fix-allow-adding-a-local-folder-even-when-there-is-a.patch similarity index 100% rename from vscode-patches/0031-fix-allow-adding-a-local-folder-even-when-there-is-a.patch rename to vscode-patches/0030-fix-allow-adding-a-local-folder-even-when-there-is-a.patch diff --git a/vscode-patches/0032-feat-allow-to-switch-storage-service-workspace.patch b/vscode-patches/0031-feat-allow-to-switch-storage-service-workspace.patch similarity index 100% rename from vscode-patches/0032-feat-allow-to-switch-storage-service-workspace.patch rename to vscode-patches/0031-feat-allow-to-switch-storage-service-workspace.patch diff --git a/vscode-patches/0033-cleanup-remove-code-that-we-will-run-ourselves.patch b/vscode-patches/0032-cleanup-remove-code-that-we-will-run-ourselves.patch similarity index 100% rename from vscode-patches/0033-cleanup-remove-code-that-we-will-run-ourselves.patch rename to vscode-patches/0032-cleanup-remove-code-that-we-will-run-ourselves.patch diff --git a/vscode-patches/0034-fix-typescript-use-import-function-able-to-replace-i.patch b/vscode-patches/0033-fix-typescript-use-import-function-able-to-replace-i.patch similarity index 100% rename from vscode-patches/0034-fix-typescript-use-import-function-able-to-replace-i.patch rename to vscode-patches/0033-fix-typescript-use-import-function-able-to-replace-i.patch diff --git a/vscode-patches/0035-feat-add-a-way-to-detect-if-localization-were-alread.patch b/vscode-patches/0034-feat-add-a-way-to-detect-if-localization-were-alread.patch similarity index 100% rename from vscode-patches/0035-feat-add-a-way-to-detect-if-localization-were-alread.patch rename to vscode-patches/0034-feat-add-a-way-to-detect-if-localization-were-alread.patch diff --git a/vscode-patches/0036-fix-move-action-from-service-file-to-contribution.patch b/vscode-patches/0035-fix-move-action-from-service-file-to-contribution.patch similarity index 100% rename from vscode-patches/0036-fix-move-action-from-service-file-to-contribution.patch rename to vscode-patches/0035-fix-move-action-from-service-file-to-contribution.patch diff --git a/vscode-patches/0037-refactor-split-workbench-contribution.patch b/vscode-patches/0036-refactor-split-workbench-contribution.patch similarity index 100% rename from vscode-patches/0037-refactor-split-workbench-contribution.patch rename to vscode-patches/0036-refactor-split-workbench-contribution.patch diff --git a/vscode-patches/0038-refactor-split-service-and-extension-point.patch b/vscode-patches/0037-refactor-split-service-and-extension-point.patch similarity index 100% rename from vscode-patches/0038-refactor-split-service-and-extension-point.patch rename to vscode-patches/0037-refactor-split-service-and-extension-point.patch diff --git a/vscode-patches/0039-fix-weird-syntax.patch b/vscode-patches/0038-fix-weird-syntax.patch similarity index 100% rename from vscode-patches/0039-fix-weird-syntax.patch rename to vscode-patches/0038-fix-weird-syntax.patch diff --git a/vscode-patches/0040-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch b/vscode-patches/0039-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch similarity index 100% rename from vscode-patches/0040-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch rename to vscode-patches/0039-fix-do-not-export-stuff-from-web-workbench-or-the-ty.patch diff --git a/vscode-patches/0041-fix-change-syntax-that-language-service-refactor-doe.patch b/vscode-patches/0040-fix-change-syntax-that-language-service-refactor-doe.patch similarity index 100% rename from vscode-patches/0041-fix-change-syntax-that-language-service-refactor-doe.patch rename to vscode-patches/0040-fix-change-syntax-that-language-service-refactor-doe.patch diff --git a/vscode-patches/0042-feat-add-build-tool-to-extract-service-identifiers.patch b/vscode-patches/0041-feat-add-build-tool-to-extract-service-identifiers.patch similarity index 100% rename from vscode-patches/0042-feat-add-build-tool-to-extract-service-identifiers.patch rename to vscode-patches/0041-feat-add-build-tool-to-extract-service-identifiers.patch diff --git a/vscode-patches/0043-refactor-split-code-to-be-able-to-import-only-requir.patch b/vscode-patches/0042-refactor-split-code-to-be-able-to-import-only-requir.patch similarity index 100% rename from vscode-patches/0043-refactor-split-code-to-be-able-to-import-only-requir.patch rename to vscode-patches/0042-refactor-split-code-to-be-able-to-import-only-requir.patch diff --git a/vscode-patches/0044-fix-just-use-regular-dynamic-import.patch b/vscode-patches/0043-fix-just-use-regular-dynamic-import.patch similarity index 100% rename from vscode-patches/0044-fix-just-use-regular-dynamic-import.patch rename to vscode-patches/0043-fix-just-use-regular-dynamic-import.patch diff --git a/vscode-patches/0045-fix-allow-data-urls-in-extension-host-worker.patch b/vscode-patches/0044-fix-allow-data-urls-in-extension-host-worker.patch similarity index 100% rename from vscode-patches/0045-fix-allow-data-urls-in-extension-host-worker.patch rename to vscode-patches/0044-fix-allow-data-urls-in-extension-host-worker.patch diff --git a/vscode-patches/0046-fix-stop-expecting-a-git-context.patch b/vscode-patches/0045-fix-stop-expecting-a-git-context.patch similarity index 100% rename from vscode-patches/0046-fix-stop-expecting-a-git-context.patch rename to vscode-patches/0045-fix-stop-expecting-a-git-context.patch diff --git a/vscode-patches/0047-fix-extract-constants-into-separate-module.patch b/vscode-patches/0046-fix-extract-constants-into-separate-module.patch similarity index 100% rename from vscode-patches/0047-fix-extract-constants-into-separate-module.patch rename to vscode-patches/0046-fix-extract-constants-into-separate-module.patch diff --git a/vscode-patches/0048-fix-store-activeChatController-in-another-module.patch b/vscode-patches/0047-fix-store-activeChatController-in-another-module.patch similarity index 100% rename from vscode-patches/0048-fix-store-activeChatController-in-another-module.patch rename to vscode-patches/0047-fix-store-activeChatController-in-another-module.patch diff --git a/vscode-patches/0049-feat-add-transformConstEnums-script.patch b/vscode-patches/0048-feat-add-transformConstEnums-script.patch similarity index 100% rename from vscode-patches/0049-feat-add-transformConstEnums-script.patch rename to vscode-patches/0048-feat-add-transformConstEnums-script.patch diff --git a/vscode-patches/0050-fix-prevent-importing-class-just-to-check-intance.patch b/vscode-patches/0049-fix-prevent-importing-class-just-to-check-intance.patch similarity index 100% rename from vscode-patches/0050-fix-prevent-importing-class-just-to-check-intance.patch rename to vscode-patches/0049-fix-prevent-importing-class-just-to-check-intance.patch diff --git a/vscode-patches/0051-refactor-use-URL-syntax-prevent-importing-amdX-at-al.patch b/vscode-patches/0050-refactor-use-URL-syntax-prevent-importing-amdX-at-al.patch similarity index 100% rename from vscode-patches/0051-refactor-use-URL-syntax-prevent-importing-amdX-at-al.patch rename to vscode-patches/0050-refactor-use-URL-syntax-prevent-importing-amdX-at-al.patch diff --git a/vscode-patches/0052-feat-support-configuring-worker-options.patch b/vscode-patches/0051-feat-support-configuring-worker-options.patch similarity index 100% rename from vscode-patches/0052-feat-support-configuring-worker-options.patch rename to vscode-patches/0051-feat-support-configuring-worker-options.patch diff --git a/vscode-patches/0053-fix-always-set-parent-origin.patch b/vscode-patches/0052-fix-always-set-parent-origin.patch similarity index 100% rename from vscode-patches/0053-fix-always-set-parent-origin.patch rename to vscode-patches/0052-fix-always-set-parent-origin.patch diff --git a/vscode-patches/0054-fix-change-imort-style-to-help-extractService-script.patch b/vscode-patches/0053-fix-change-imort-style-to-help-extractService-script.patch similarity index 100% rename from vscode-patches/0054-fix-change-imort-style-to-help-extractService-script.patch rename to vscode-patches/0053-fix-change-imort-style-to-help-extractService-script.patch diff --git a/vscode-patches/0055-fix-remove-weird-type-reference-to-fix-the-build.patch b/vscode-patches/0054-fix-remove-weird-type-reference-to-fix-the-build.patch similarity index 100% rename from vscode-patches/0055-fix-remove-weird-type-reference-to-fix-the-build.patch rename to vscode-patches/0054-fix-remove-weird-type-reference-to-fix-the-build.patch diff --git a/vscode-patches/0056-fix-break-cyclic-dependency.patch b/vscode-patches/0055-fix-break-cyclic-dependency.patch similarity index 100% rename from vscode-patches/0056-fix-break-cyclic-dependency.patch rename to vscode-patches/0055-fix-break-cyclic-dependency.patch diff --git a/vscode-patches/0057-fix-ignore-vscode-tree-sitter-wasm-until-MS-fixes-it.patch b/vscode-patches/0056-fix-ignore-vscode-tree-sitter-wasm-until-MS-fixes-it.patch similarity index 100% rename from vscode-patches/0057-fix-ignore-vscode-tree-sitter-wasm-until-MS-fixes-it.patch rename to vscode-patches/0056-fix-ignore-vscode-tree-sitter-wasm-until-MS-fixes-it.patch diff --git a/vscode-patches/0058-feat-add-new-task-that-only-export-editor-types.patch b/vscode-patches/0057-feat-add-new-task-that-only-export-editor-types.patch similarity index 100% rename from vscode-patches/0058-feat-add-new-task-that-only-export-editor-types.patch rename to vscode-patches/0057-feat-add-new-task-that-only-export-editor-types.patch diff --git a/vscode-patches/0059-fix-prevent-proxy-from-being-detected-as-a-promise.patch b/vscode-patches/0058-fix-prevent-proxy-from-being-detected-as-a-promise.patch similarity index 100% rename from vscode-patches/0059-fix-prevent-proxy-from-being-detected-as-a-promise.patch rename to vscode-patches/0058-fix-prevent-proxy-from-being-detected-as-a-promise.patch diff --git a/vscode-patches/0060-feat-support-shadow-dom.patch b/vscode-patches/0059-feat-support-shadow-dom.patch similarity index 98% rename from vscode-patches/0060-feat-support-shadow-dom.patch rename to vscode-patches/0059-feat-support-shadow-dom.patch index 591a4769..5ea1ad94 100644 --- a/vscode-patches/0060-feat-support-shadow-dom.patch +++ b/vscode-patches/0059-feat-support-shadow-dom.patch @@ -33,6 +33,7 @@ Subject: [PATCH] feat: support shadow dom .../platform/layout/browser/zIndexRegistry.ts | 2 +- .../platform/theme/browser/iconsStyleSheet.ts | 2 +- .../browser/userInteractionServiceImpl.ts | 5 +- + src/vs/sessions/browser/workbench.ts | 3 + .../agentFeedbackEditorInputContribution.ts | 6 +- .../browser/actions/developerActions.ts | 4 +- src/vs/workbench/browser/layout.ts | 3 + @@ -67,7 +68,7 @@ Subject: [PATCH] feat: support shadow dom .../browser/auxiliaryWindowService.ts | 6 +- .../suggest/browser/simpleSuggestWidget.ts | 4 +- .../themes/browser/workbenchThemeService.ts | 33 +++++++++- - 63 files changed, 260 insertions(+), 148 deletions(-) + 64 files changed, 263 insertions(+), 148 deletions(-) diff --git a/src/vs/base/browser/dom.ts b/src/vs/base/browser/dom.ts index 6d7ea0fbd8e..e037f9e58db 100644 @@ -874,6 +875,27 @@ index e0431c43297..3becb497383 100644 return el.contains(activeElement); }; +diff --git a/src/vs/sessions/browser/workbench.ts b/src/vs/sessions/browser/workbench.ts +index 6b73a61171f..99be882b639 100644 +--- a/src/vs/sessions/browser/workbench.ts ++++ b/src/vs/sessions/browser/workbench.ts +@@ -83,6 +83,7 @@ import { ICustomViewDescriptor } from '../services/customView/browser/customView + import { ISessionsSetUpService } from './sessionsSetUpService.js'; + import { AGENTS_FLOATING_PANEL_GAP } from '../common/layoutConstants.js'; + import { ITelemetryService } from '../../platform/telemetry/common/telemetry.js'; ++import { setContainerElement } from '../../base/browser/domStylesheets.js'; + + const PHONE_NOTIFICATION_ROW_HEIGHT = 44; + +@@ -488,6 +489,8 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic + ) { + super(); + ++ setContainerElement(parent); ++ + // Sessions-scoped mobile viewport tweaks. These are applied here + // (rather than in the shared workbench.html) so that the regular + // code-web workbench โ€” which does not handle safe-area insets โ€” is diff --git a/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackEditorInputContribution.ts b/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackEditorInputContribution.ts index f7b8ece70c2..81d0bcd9dd7 100644 --- a/src/vs/sessions/contrib/agentFeedback/browser/agentFeedbackEditorInputContribution.ts diff --git a/vscode-patches/0061-feat-support-adoptedStyleSheets-for-aux-windows.patch b/vscode-patches/0060-feat-support-adoptedStyleSheets-for-aux-windows.patch similarity index 100% rename from vscode-patches/0061-feat-support-adoptedStyleSheets-for-aux-windows.patch rename to vscode-patches/0060-feat-support-adoptedStyleSheets-for-aux-windows.patch diff --git a/vscode-patches/0062-fix-prevent-NPE-when-using-shadow-dom.patch b/vscode-patches/0061-fix-prevent-NPE-when-using-shadow-dom.patch similarity index 100% rename from vscode-patches/0062-fix-prevent-NPE-when-using-shadow-dom.patch rename to vscode-patches/0061-fix-prevent-NPE-when-using-shadow-dom.patch diff --git a/vscode-patches/0063-feat-add-a-context-key-to-enable-further-customizati.patch b/vscode-patches/0062-feat-add-a-context-key-to-enable-further-customizati.patch similarity index 100% rename from vscode-patches/0063-feat-add-a-context-key-to-enable-further-customizati.patch rename to vscode-patches/0062-feat-add-a-context-key-to-enable-further-customizati.patch diff --git a/vscode-patches/0064-fix-break-cyclic-dependency.patch b/vscode-patches/0063-fix-break-cyclic-dependency.patch similarity index 100% rename from vscode-patches/0064-fix-break-cyclic-dependency.patch rename to vscode-patches/0063-fix-break-cyclic-dependency.patch diff --git a/vscode-patches/0065-feat-allow-to-override-product-icon.patch b/vscode-patches/0064-feat-allow-to-override-product-icon.patch similarity index 100% rename from vscode-patches/0065-feat-allow-to-override-product-icon.patch rename to vscode-patches/0064-feat-allow-to-override-product-icon.patch diff --git a/vscode-patches/0066-feat-prevent-IDE-from-entering-fullscreen-if-not-occ.patch b/vscode-patches/0065-feat-prevent-IDE-from-entering-fullscreen-if-not-occ.patch similarity index 100% rename from vscode-patches/0066-feat-prevent-IDE-from-entering-fullscreen-if-not-occ.patch rename to vscode-patches/0065-feat-prevent-IDE-from-entering-fullscreen-if-not-occ.patch diff --git a/vscode-patches/0067-feat-support-loading-VSCode-in-an-iframe.patch b/vscode-patches/0066-feat-support-loading-VSCode-in-an-iframe.patch similarity index 100% rename from vscode-patches/0067-feat-support-loading-VSCode-in-an-iframe.patch rename to vscode-patches/0066-feat-support-loading-VSCode-in-an-iframe.patch diff --git a/vscode-patches/0068-feat-mark-elements-created-outside-of-the-VSCode-con.patch b/vscode-patches/0067-feat-mark-elements-created-outside-of-the-VSCode-con.patch similarity index 100% rename from vscode-patches/0068-feat-mark-elements-created-outside-of-the-VSCode-con.patch rename to vscode-patches/0067-feat-mark-elements-created-outside-of-the-VSCode-con.patch diff --git a/vscode-patches/0069-feat-centralize-element-creation-to-be-able-to-creat.patch b/vscode-patches/0068-feat-centralize-element-creation-to-be-able-to-creat.patch similarity index 99% rename from vscode-patches/0069-feat-centralize-element-creation-to-be-able-to-creat.patch rename to vscode-patches/0068-feat-centralize-element-creation-to-be-able-to-creat.patch index 062a1085..384cb581 100644 --- a/vscode-patches/0069-feat-centralize-element-creation-to-be-able-to-creat.patch +++ b/vscode-patches/0068-feat-centralize-element-creation-to-be-able-to-creat.patch @@ -3602,7 +3602,7 @@ index 47cd222b00e..56ea77e5114 100644 input.className = 'chat-composite-bar-session-title-input'; input.value = initialTitle; diff --git a/src/vs/sessions/browser/workbench.ts b/src/vs/sessions/browser/workbench.ts -index 6b73a61171f..550f622ac16 100644 +index 99be882b639..3ac2263adf5 100644 --- a/src/vs/sessions/browser/workbench.ts +++ b/src/vs/sessions/browser/workbench.ts @@ -9,7 +9,7 @@ import './media/workbench.css'; @@ -3614,7 +3614,7 @@ index 6b73a61171f..550f622ac16 100644 import { DeferredPromise, RunOnceScheduler } from '../../base/common/async.js'; import { isFullscreen, onDidChangeFullscreen, isChrome, isFirefox, isSafari } from '../../base/browser/browser.js'; import { mark } from '../../base/common/performance.js'; -@@ -335,7 +335,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic +@@ -336,7 +336,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic //#region Properties @@ -3623,7 +3623,7 @@ index 6b73a61171f..550f622ac16 100644 get activeContainer(): HTMLElement { return this.getContainerFromDocument(getActiveDocument()); -@@ -1081,7 +1081,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic +@@ -1084,7 +1084,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic } private createPartContainer(id: string, role: string, classes: string[]): HTMLElement { @@ -3632,7 +3632,7 @@ index 6b73a61171f..550f622ac16 100644 part.classList.add('part', ...classes); part.id = id; part.setAttribute('role', role); -@@ -1089,7 +1089,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic +@@ -1092,7 +1092,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic } private createEditorPart(): void { @@ -3641,7 +3641,7 @@ index 6b73a61171f..550f622ac16 100644 editorPartContainer.classList.add('part', 'editor'); editorPartContainer.id = Parts.EDITOR_PART; editorPartContainer.setAttribute('role', 'main'); -@@ -1105,7 +1105,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic +@@ -1108,7 +1108,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic } private createSessionsPart(): void { @@ -3650,7 +3650,7 @@ index 6b73a61171f..550f622ac16 100644 sessionsPartContainer.classList.add('part', 'sessionspart', 'basepanel', 'right', AGENTS_PART_CARD_CLASS); sessionsPartContainer.id = Parts.SESSIONS_PART; sessionsPartContainer.setAttribute('role', 'main'); -@@ -1153,7 +1153,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic +@@ -1156,7 +1156,7 @@ export class Workbench extends Disposable implements IAgentWorkbenchLayoutServic } private createCustomViewGridPart(): void { diff --git a/vscode-patches/0070-fix-close-auxiliary-window-when-the-context-is-unloa.patch b/vscode-patches/0069-fix-close-auxiliary-window-when-the-context-is-unloa.patch similarity index 100% rename from vscode-patches/0070-fix-close-auxiliary-window-when-the-context-is-unloa.patch rename to vscode-patches/0069-fix-close-auxiliary-window-when-the-context-is-unloa.patch diff --git a/vscode-patches/0071-refactor-make-editors-register-themself.patch b/vscode-patches/0070-refactor-make-editors-register-themself.patch similarity index 100% rename from vscode-patches/0071-refactor-make-editors-register-themself.patch rename to vscode-patches/0070-refactor-make-editors-register-themself.patch diff --git a/vscode-patches/0072-fix-also-register-the-quickinput-container.patch b/vscode-patches/0071-fix-also-register-the-quickinput-container.patch similarity index 100% rename from vscode-patches/0072-fix-also-register-the-quickinput-container.patch rename to vscode-patches/0071-fix-also-register-the-quickinput-container.patch diff --git a/vscode-patches/0073-refactor-split-contribution.patch b/vscode-patches/0072-refactor-split-contribution.patch similarity index 100% rename from vscode-patches/0073-refactor-split-contribution.patch rename to vscode-patches/0072-refactor-split-contribution.patch diff --git a/vscode-patches/0074-fix-make-field-optional-as-sometime-openvsix-doesn-t.patch b/vscode-patches/0073-fix-make-field-optional-as-sometime-openvsix-doesn-t.patch similarity index 100% rename from vscode-patches/0074-fix-make-field-optional-as-sometime-openvsix-doesn-t.patch rename to vscode-patches/0073-fix-make-field-optional-as-sometime-openvsix-doesn-t.patch diff --git a/vscode-patches/0075-fix-properly-use-IExtensionResourceLoaderService-ins.patch b/vscode-patches/0074-fix-properly-use-IExtensionResourceLoaderService-ins.patch similarity index 100% rename from vscode-patches/0075-fix-properly-use-IExtensionResourceLoaderService-ins.patch rename to vscode-patches/0074-fix-properly-use-IExtensionResourceLoaderService-ins.patch diff --git a/vscode-patches/0076-feat-add-customEditorRestore.patch b/vscode-patches/0075-feat-add-customEditorRestore.patch similarity index 100% rename from vscode-patches/0076-feat-add-customEditorRestore.patch rename to vscode-patches/0075-feat-add-customEditorRestore.patch diff --git a/vscode-patches/0077-fix-fix-focus-conflict.patch b/vscode-patches/0076-fix-fix-focus-conflict.patch similarity index 100% rename from vscode-patches/0077-fix-fix-focus-conflict.patch rename to vscode-patches/0076-fix-fix-focus-conflict.patch diff --git a/vscode-patches/0078-refactor-extract-shouldAttemptTaskReconnection-flag.patch b/vscode-patches/0077-refactor-extract-shouldAttemptTaskReconnection-flag.patch similarity index 100% rename from vscode-patches/0078-refactor-extract-shouldAttemptTaskReconnection-flag.patch rename to vscode-patches/0077-refactor-extract-shouldAttemptTaskReconnection-flag.patch diff --git a/vscode-patches/0079-fix-remove-empty-layout-message-before-actual-view-l.patch b/vscode-patches/0078-fix-remove-empty-layout-message-before-actual-view-l.patch similarity index 100% rename from vscode-patches/0079-fix-remove-empty-layout-message-before-actual-view-l.patch rename to vscode-patches/0078-fix-remove-empty-layout-message-before-actual-view-l.patch diff --git a/vscode-patches/0080-fix-backport-configuration-editing-built-in-extensio.patch b/vscode-patches/0079-fix-backport-configuration-editing-built-in-extensio.patch similarity index 100% rename from vscode-patches/0080-fix-backport-configuration-editing-built-in-extensio.patch rename to vscode-patches/0079-fix-backport-configuration-editing-built-in-extensio.patch diff --git a/vscode-patches/0081-refactor-split-code-to-be-able-to-override-behavior.patch b/vscode-patches/0080-refactor-split-code-to-be-able-to-override-behavior.patch similarity index 100% rename from vscode-patches/0081-refactor-split-code-to-be-able-to-override-behavior.patch rename to vscode-patches/0080-refactor-split-code-to-be-able-to-override-behavior.patch diff --git a/vscode-patches/0082-fix-fix-screencast-mode-mouse-marker-position.patch b/vscode-patches/0081-fix-fix-screencast-mode-mouse-marker-position.patch similarity index 100% rename from vscode-patches/0082-fix-fix-screencast-mode-mouse-marker-position.patch rename to vscode-patches/0081-fix-fix-screencast-mode-mouse-marker-position.patch diff --git a/vscode-patches/0083-fix-make-product-field-optional.patch b/vscode-patches/0082-fix-make-product-field-optional.patch similarity index 100% rename from vscode-patches/0083-fix-make-product-field-optional.patch rename to vscode-patches/0082-fix-make-product-field-optional.patch diff --git a/vscode-patches/0084-fix-remove-problematic-code-causing-issues-with-webp.patch b/vscode-patches/0083-fix-remove-problematic-code-causing-issues-with-webp.patch similarity index 100% rename from vscode-patches/0084-fix-remove-problematic-code-causing-issues-with-webp.patch rename to vscode-patches/0083-fix-remove-problematic-code-causing-issues-with-webp.patch diff --git a/vscode-patches/0085-feat-support-disabling-view-containers.patch b/vscode-patches/0084-feat-support-disabling-view-containers.patch similarity index 100% rename from vscode-patches/0085-feat-support-disabling-view-containers.patch rename to vscode-patches/0084-feat-support-disabling-view-containers.patch diff --git a/vscode-patches/0086-feat-add-terminal.integrated.preserveDrawingBuffer-s.patch b/vscode-patches/0085-feat-add-terminal.integrated.preserveDrawingBuffer-s.patch similarity index 100% rename from vscode-patches/0086-feat-add-terminal.integrated.preserveDrawingBuffer-s.patch rename to vscode-patches/0085-feat-add-terminal.integrated.preserveDrawingBuffer-s.patch diff --git a/vscode-patches/0087-refactor-only-import-chat-related-stuff-from-chat-co.patch b/vscode-patches/0086-refactor-only-import-chat-related-stuff-from-chat-co.patch similarity index 100% rename from vscode-patches/0087-refactor-only-import-chat-related-stuff-from-chat-co.patch rename to vscode-patches/0086-refactor-only-import-chat-related-stuff-from-chat-co.patch diff --git a/vscode-patches/0088-refactor-extract-storage-creation-method.patch b/vscode-patches/0087-refactor-extract-storage-creation-method.patch similarity index 100% rename from vscode-patches/0088-refactor-extract-storage-creation-method.patch rename to vscode-patches/0087-refactor-extract-storage-creation-method.patch diff --git a/vscode-patches/0089-feat-allow-defining-the-workspace-id.patch b/vscode-patches/0088-feat-allow-defining-the-workspace-id.patch similarity index 100% rename from vscode-patches/0089-feat-allow-defining-the-workspace-id.patch rename to vscode-patches/0088-feat-allow-defining-the-workspace-id.patch diff --git a/vscode-patches/0090-fix-do-not-hide-copilot-ui-on-web-mode.patch b/vscode-patches/0089-fix-do-not-hide-copilot-ui-on-web-mode.patch similarity index 100% rename from vscode-patches/0090-fix-do-not-hide-copilot-ui-on-web-mode.patch rename to vscode-patches/0089-fix-do-not-hide-copilot-ui-on-web-mode.patch diff --git a/vscode-patches/0091-feat-add-AIDisabled-policy.patch b/vscode-patches/0090-feat-add-AIDisabled-policy.patch similarity index 100% rename from vscode-patches/0091-feat-add-AIDisabled-policy.patch rename to vscode-patches/0090-feat-add-AIDisabled-policy.patch diff --git a/vscode-patches/0092-feat-support-disabling-specific-extension-from-workb.patch b/vscode-patches/0091-feat-support-disabling-specific-extension-from-workb.patch similarity index 100% rename from vscode-patches/0092-feat-support-disabling-specific-extension-from-workb.patch rename to vscode-patches/0091-feat-support-disabling-specific-extension-from-workb.patch diff --git a/vscode-patches/0093-fix-chat-always-update-auxiliary-bar.patch b/vscode-patches/0092-fix-chat-always-update-auxiliary-bar.patch similarity index 100% rename from vscode-patches/0093-fix-chat-always-update-auxiliary-bar.patch rename to vscode-patches/0092-fix-chat-always-update-auxiliary-bar.patch diff --git a/vscode-patches/0094-fix-do-not-hide-the-sidebar-forcefully-if-the-settin.patch b/vscode-patches/0093-fix-do-not-hide-the-sidebar-forcefully-if-the-settin.patch similarity index 100% rename from vscode-patches/0094-fix-do-not-hide-the-sidebar-forcefully-if-the-settin.patch rename to vscode-patches/0093-fix-do-not-hide-the-sidebar-forcefully-if-the-settin.patch diff --git a/vscode-patches/0095-fix-dedup-import.patch b/vscode-patches/0094-fix-dedup-import.patch similarity index 100% rename from vscode-patches/0095-fix-dedup-import.patch rename to vscode-patches/0094-fix-dedup-import.patch diff --git a/vscode-patches/0096-fix-workaround-firefox-bug.patch b/vscode-patches/0095-fix-workaround-firefox-bug.patch similarity index 100% rename from vscode-patches/0096-fix-workaround-firefox-bug.patch rename to vscode-patches/0095-fix-workaround-firefox-bug.patch diff --git a/vscode-patches/0097-fix-remove-unused-import.patch b/vscode-patches/0096-fix-remove-unused-import.patch similarity index 100% rename from vscode-patches/0097-fix-remove-unused-import.patch rename to vscode-patches/0096-fix-remove-unused-import.patch diff --git a/vscode-patches/0098-fix-remove-webview-hash-verification.patch b/vscode-patches/0097-fix-remove-webview-hash-verification.patch similarity index 100% rename from vscode-patches/0098-fix-remove-webview-hash-verification.patch rename to vscode-patches/0097-fix-remove-webview-hash-verification.patch diff --git a/vscode-patches/0099-fix-default-view-container-may-not-exist.patch b/vscode-patches/0098-fix-default-view-container-may-not-exist.patch similarity index 100% rename from vscode-patches/0099-fix-default-view-container-may-not-exist.patch rename to vscode-patches/0098-fix-default-view-container-may-not-exist.patch diff --git a/vscode-patches/0100-fix-make-default-configuration-scope-rely-on-the-has.patch b/vscode-patches/0099-fix-make-default-configuration-scope-rely-on-the-has.patch similarity index 100% rename from vscode-patches/0100-fix-make-default-configuration-scope-rely-on-the-has.patch rename to vscode-patches/0099-fix-make-default-configuration-scope-rely-on-the-has.patch diff --git a/vscode-patches/0101-fix-remove-useless-check-that-prevents-ai-assist-fro.patch b/vscode-patches/0100-fix-remove-useless-check-that-prevents-ai-assist-fro.patch similarity index 100% rename from vscode-patches/0101-fix-remove-useless-check-that-prevents-ai-assist-fro.patch rename to vscode-patches/0100-fix-remove-useless-check-that-prevents-ai-assist-fro.patch diff --git a/vscode-patches/0102-refactor-move-interface-in-common.patch b/vscode-patches/0101-refactor-move-interface-in-common.patch similarity index 100% rename from vscode-patches/0102-refactor-move-interface-in-common.patch rename to vscode-patches/0101-refactor-move-interface-in-common.patch diff --git a/vscode-patches/0103-fix-remove-vscode-infra-specific-security-checks.patch b/vscode-patches/0102-fix-remove-vscode-infra-specific-security-checks.patch similarity index 100% rename from vscode-patches/0103-fix-remove-vscode-infra-specific-security-checks.patch rename to vscode-patches/0102-fix-remove-vscode-infra-specific-security-checks.patch diff --git a/vscode-patches/0104-fix-minify-and-split-mermaid-webview-scripts.patch b/vscode-patches/0103-fix-minify-and-split-mermaid-webview-scripts.patch similarity index 100% rename from vscode-patches/0104-fix-minify-and-split-mermaid-webview-scripts.patch rename to vscode-patches/0103-fix-minify-and-split-mermaid-webview-scripts.patch diff --git a/vscode-patches/0105-feat-support-using-a-unique-subdomain-for-the-extHos.patch b/vscode-patches/0104-feat-support-using-a-unique-subdomain-for-the-extHos.patch similarity index 100% rename from vscode-patches/0105-feat-support-using-a-unique-subdomain-for-the-extHos.patch rename to vscode-patches/0104-feat-support-using-a-unique-subdomain-for-the-extHos.patch diff --git a/vscode-patches/0106-fix-stop-disabling-browser-cache.patch b/vscode-patches/0105-fix-stop-disabling-browser-cache.patch similarity index 100% rename from vscode-patches/0106-fix-stop-disabling-browser-cache.patch rename to vscode-patches/0105-fix-stop-disabling-browser-cache.patch diff --git a/vscode-patches/0107-fix-prevent-generating-invalid-iframe-urls.patch b/vscode-patches/0106-fix-prevent-generating-invalid-iframe-urls.patch similarity index 100% rename from vscode-patches/0107-fix-prevent-generating-invalid-iframe-urls.patch rename to vscode-patches/0106-fix-prevent-generating-invalid-iframe-urls.patch diff --git a/vscode-patches/0108-fix-prevent-floating-error-promises.patch b/vscode-patches/0107-fix-prevent-floating-error-promises.patch similarity index 100% rename from vscode-patches/0108-fix-prevent-floating-error-promises.patch rename to vscode-patches/0107-fix-prevent-floating-error-promises.patch From c1e1a363835c5debc7d81941410e06e525586de1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 28 Sep 2026 12:38:55 +0200 Subject: [PATCH 21/35] fix: properly dispatch service impls accross chat/config/view/workbench --- src/service-override/chat/classic.ts | 68 +------ src/service-override/chat/common.ts | 53 +++++- src/service-override/chat/session.ts | 13 +- src/service-override/configuration/classic.ts | 171 +++-------------- src/service-override/configuration/common.ts | 141 ++++++++++++++ src/service-override/configuration/session.ts | 172 +++--------------- src/service-override/mcp/common.ts | 10 +- src/service-override/viewCommon/classic.ts | 7 +- src/service-override/viewCommon/common.ts | 9 +- src/service-override/viewCommon/session.ts | 13 +- src/service-override/workbench/classic.ts | 6 +- src/service-override/workbench/common.ts | 1 + src/service-override/workbench/session.ts | 32 ++-- 13 files changed, 306 insertions(+), 390 deletions(-) create mode 100644 src/service-override/configuration/common.ts diff --git a/src/service-override/chat/classic.ts b/src/service-override/chat/classic.ts index b2b2739c..ad643675 100644 --- a/src/service-override/chat/classic.ts +++ b/src/service-override/chat/classic.ts @@ -1,28 +1,18 @@ import type { IDefaultAccount } from 'vs/base/common/defaultAccount' -import { Event } from 'vs/base/common/event' import { type IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import { RemoteAgentHostService } from 'vs/platform/agentHost/browser/remoteAgentHostServiceImpl' import { IRemoteAgentHostService } from 'vs/platform/agentHost/common/remoteAgentHostService.service' -import { MANAGED_SETTINGS_FRESHNESS_NOT_REQUIRED } from 'vs/platform/defaultAccount/common/defaultAccount' -import { IDefaultAccountService } from 'vs/platform/defaultAccount/common/defaultAccount.service' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { AgentsVoiceWindowService } from 'vs/workbench/contrib/agentsVoice/browser/agentsVoiceWindowService' import { IAgentsVoiceWindowService } from 'vs/workbench/contrib/agentsVoice/common/agentsVoice.service' -import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution' import { NullAgentHostCustomizationService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService' import { IAgentHostCustomizationService } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostCustomizationService.service' -import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution' -import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution' -import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution' import { AICustomizationWorkspaceService } from 'vs/workbench/contrib/chat/browser/aiCustomization/aiCustomizationWorkspaceService' import { CustomizationHarnessService } from 'vs/workbench/contrib/chat/browser/aiCustomization/customizationHarnessService' -import 'vs/workbench/contrib/chat/browser/chat.contribution' -import 'vs/workbench/contrib/chat/browser/chat.view.contribution' import { IAICustomizationWorkspaceService } from 'vs/workbench/contrib/chat/common/aiCustomizationWorkspaceService.service' import { ICustomizationHarnessService } from 'vs/workbench/contrib/chat/common/customizationHarnessService.service' import { IPromptsService } from 'vs/workbench/contrib/chat/common/promptSyntax/service/promptsService.service' import { PromptsService } from 'vs/workbench/contrib/chat/common/promptSyntax/service/promptsServiceImpl' -import 'vs/workbench/contrib/inlineChat/browser/inlineChat.contribution' import { InlineChatSessionResolver } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSessionResolver' import { IInlineChatSessionResolver } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSessionResolver.service' import { IInlineChatSessionService } from 'vs/workbench/contrib/inlineChat/browser/inlineChatSessionService.service' @@ -31,55 +21,21 @@ import { ChatEntitlement, type IChatEntitlementContextState } from 'vs/workbench/services/chat/common/chatEntitlementService' -import getCommonServiceOverride from './common.js' +import getCommonServiceOverride, { type ChatServiceOverrideOptions } from './common.js' export type { ITelemetryData, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry' - -class DefaultAccountService implements IDefaultAccountService { - declare _serviceBrand: undefined - constructor(private defaultAccount: IDefaultAccount | null) {} - - resolveGitHubUrl: IDefaultAccountService['resolveGitHubUrl'] = (path) => path - currentDefaultAccount: IDefaultAccountService['currentDefaultAccount'] = null - - onDidChangePolicyData: IDefaultAccountService['onDidChangePolicyData'] = Event.None - policyData: IDefaultAccountService['policyData'] = null - managedSettingsFetchStatus: IDefaultAccountService['managedSettingsFetchStatus'] = null - managedSettingsFetchedAt: IDefaultAccountService['managedSettingsFetchedAt'] = null - managedSettingsRawResponse: IDefaultAccountService['managedSettingsRawResponse'] = undefined - managedSettingsCompatibilityError: IDefaultAccountService['managedSettingsCompatibilityError'] = - null - onDidChangeManagedSettingsCompatibilityError: IDefaultAccountService['onDidChangeManagedSettingsCompatibilityError'] = - Event.None - managedSettingsFreshness: IDefaultAccountService['managedSettingsFreshness'] = - MANAGED_SETTINGS_FRESHNESS_NOT_REQUIRED - onDidChangeManagedSettingsFreshness: IDefaultAccountService['onDidChangeManagedSettingsFreshness'] = - Event.None - - getDefaultAccountAuthenticationProvider: IDefaultAccountService['getDefaultAccountAuthenticationProvider'] = - () => ({ id: 'default', name: 'Default', enterprise: false }) - setDefaultAccountProvider: IDefaultAccountService['setDefaultAccountProvider'] = () => {} - refresh: IDefaultAccountService['refresh'] = async () => null - signIn: IDefaultAccountService['signIn'] = async () => null - - readonly onDidChangeDefaultAccount: IDefaultAccountService['onDidChangeDefaultAccount'] = - Event.None - - getDefaultAccount: IDefaultAccountService['getDefaultAccount'] = async () => this.defaultAccount - - copilotTokenInfo: IDefaultAccountService['copilotTokenInfo'] = null - onDidChangeCopilotTokenInfo: IDefaultAccountService['onDidChangeCopilotTokenInfo'] = Event.None - signOut: IDefaultAccountService['signOut'] = async () => {} -} - -export interface ChatServiceOverrideOptions { - defaultAccount?: IDefaultAccount -} +import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution' +import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution' +import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution' +import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/openSessionLinkOpener.contribution' +import 'vs/workbench/contrib/chat/browser/chat.contribution' +import 'vs/workbench/contrib/chat/browser/chat.view.contribution' +import 'vs/workbench/contrib/inlineChat/browser/inlineChat.contribution' export default function getServiceOverride({ defaultAccount }: ChatServiceOverrideOptions = {}): IEditorOverrideServices { return { - ...getCommonServiceOverride(), + ...getCommonServiceOverride({ defaultAccount }), [IInlineChatSessionService.toString()]: new SyncDescriptor( InlineChatSessionServiceImpl, [], @@ -91,11 +47,7 @@ export default function getServiceOverride({ [], true ), - [IDefaultAccountService.toString()]: new SyncDescriptor( - DefaultAccountService, - [defaultAccount], - true - ), + [ICustomizationHarnessService.toString()]: new SyncDescriptor( CustomizationHarnessService, [], diff --git a/src/service-override/chat/common.ts b/src/service-override/chat/common.ts index 179f56f7..357f89ba 100644 --- a/src/service-override/chat/common.ts +++ b/src/service-override/chat/common.ts @@ -224,6 +224,9 @@ import { IChatEntitlementService } from 'vs/workbench/services/chat/common/chatE import { LinkPresentationService } from 'vs/workbench/services/dataChannel/browser/dataChannelService' import { AgentHostByokLmHandler } from 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostByokLmHandler' import { IAgentHostByokLmHandler } from 'vs/platform/agentHost/common/agentHostByokLm.service' +import { IDefaultAccountService } from 'vs/platform/defaultAccount/common/defaultAccount.service' +import { Event } from 'vs/base/common/event' +import { MANAGED_SETTINGS_FRESHNESS_NOT_REQUIRED } from 'vs/platform/defaultAccount/common/defaultAccount' import 'vs/platform/agentHost/common/agentHostStarter.config.contribution' import 'vs/workbench/contrib/agentsVoice/browser/agentsVoice.contribution' import 'vs/workbench/contrib/imageCarousel/browser/imageCarousel.contribution' @@ -238,8 +241,56 @@ import 'vs/workbench/contrib/chat/browser/attachments/transcriptContextAttachmen import 'vs/workbench/api/browser/extensionHost.chat.contribution' import 'vs/workbench/contrib/chat/browser/agentSessions/experiments/agentSessionsExperiments.contribution' -export default function getServiceOverride(): IEditorOverrideServices { +class DefaultAccountService implements IDefaultAccountService { + declare _serviceBrand: undefined + constructor(private defaultAccount: IDefaultAccount | null) {} + + resolveGitHubUrl: IDefaultAccountService['resolveGitHubUrl'] = (path) => path + currentDefaultAccount: IDefaultAccountService['currentDefaultAccount'] = null + + onDidChangePolicyData: IDefaultAccountService['onDidChangePolicyData'] = Event.None + policyData: IDefaultAccountService['policyData'] = null + managedSettingsFetchStatus: IDefaultAccountService['managedSettingsFetchStatus'] = null + managedSettingsFetchedAt: IDefaultAccountService['managedSettingsFetchedAt'] = null + managedSettingsRawResponse: IDefaultAccountService['managedSettingsRawResponse'] = undefined + managedSettingsCompatibilityError: IDefaultAccountService['managedSettingsCompatibilityError'] = + null + onDidChangeManagedSettingsCompatibilityError: IDefaultAccountService['onDidChangeManagedSettingsCompatibilityError'] = + Event.None + managedSettingsFreshness: IDefaultAccountService['managedSettingsFreshness'] = + MANAGED_SETTINGS_FRESHNESS_NOT_REQUIRED + onDidChangeManagedSettingsFreshness: IDefaultAccountService['onDidChangeManagedSettingsFreshness'] = + Event.None + + getDefaultAccountAuthenticationProvider: IDefaultAccountService['getDefaultAccountAuthenticationProvider'] = + () => ({ id: 'default', name: 'Default', enterprise: false }) + setDefaultAccountProvider: IDefaultAccountService['setDefaultAccountProvider'] = () => {} + refresh: IDefaultAccountService['refresh'] = async () => null + signIn: IDefaultAccountService['signIn'] = async () => null + + readonly onDidChangeDefaultAccount: IDefaultAccountService['onDidChangeDefaultAccount'] = + Event.None + + getDefaultAccount: IDefaultAccountService['getDefaultAccount'] = async () => this.defaultAccount + + copilotTokenInfo: IDefaultAccountService['copilotTokenInfo'] = null + onDidChangeCopilotTokenInfo: IDefaultAccountService['onDidChangeCopilotTokenInfo'] = Event.None + signOut: IDefaultAccountService['signOut'] = async () => {} +} + +export interface ChatServiceOverrideOptions { + defaultAccount?: IDefaultAccount +} + +export default function getServiceOverride({ + defaultAccount +}: ChatServiceOverrideOptions = {}): IEditorOverrideServices { return { + [IDefaultAccountService.toString()]: new SyncDescriptor( + DefaultAccountService, + [defaultAccount], + true + ), [IChatService.toString()]: new SyncDescriptor(ChatService, [], true), [IChatWidgetService.toString()]: new SyncDescriptor(ChatWidgetService, [], true), [IQuickChatService.toString()]: new SyncDescriptor(QuickChatService, [], true), diff --git a/src/service-override/chat/session.ts b/src/service-override/chat/session.ts index c947bb46..79533ac0 100644 --- a/src/service-override/chat/session.ts +++ b/src/service-override/chat/session.ts @@ -18,9 +18,11 @@ import { SessionsCustomizationHarnessService } from 'vs/sessions/contrib/chat/br import { NullInlineChatSessionService } from 'vs/sessions/contrib/chat/browser/nullInlineChatSessionService' import { AgenticPromptsService } from 'vs/sessions/contrib/chat/browser/promptsService' import { AgentHostCustomizationService } from 'vs/sessions/services/agentHost/browser/agentHostCustomizationService' -import getCommonServiceOverride from './common.js' +import getCommonServiceOverride, { type ChatServiceOverrideOptions } from './common.js' import { IChatResponseFileChangesService } from 'vs/workbench/contrib/chat/browser/chatResponseFileChangesService.service.js' import { SessionsChatResponseFileChangesService } from 'vs/sessions/contrib/chat/browser/sessionTurnChanges.js' +import { IChangesViewService } from 'vs/sessions/contrib/changes/common/changesViewService.service.js' +import { ChangesViewService } from 'vs/sessions/contrib/changes/browser/changesViewService' import 'vs/sessions/contrib/chat/browser/btwSlashCommand.contribution' import 'vs/sessions/contrib/chat/browser/chat.contribution' @@ -42,9 +44,11 @@ import 'vs/sessions/contrib/providers/remoteAgentHost/browser/webSocketAgentHost import 'vs/sessions/contrib/providers/remoteAgentHost/browser/webTunnelAgentHostService.contribution' import 'vs/sessions/contrib/providers/remoteAgentHost/browser/wslAgentHost.contribution' -export default function getServiceOverride(): IEditorOverrideServices { +export default function getServiceOverride({ + defaultAccount +}: ChatServiceOverrideOptions = {}): IEditorOverrideServices { return { - ...getCommonServiceOverride(), + ...getCommonServiceOverride({ defaultAccount }), [IInlineChatSessionService.toString()]: new SyncDescriptor( NullInlineChatSessionService, [], @@ -75,7 +79,8 @@ export default function getServiceOverride(): IEditorOverrideServices { SessionsChatResponseFileChangesService, [], true - ) + ), + [IChangesViewService.toString()]: new SyncDescriptor(ChangesViewService, [], true) } } diff --git a/src/service-override/configuration/classic.ts b/src/service-override/configuration/classic.ts index cd1da81c..1d51df6c 100644 --- a/src/service-override/configuration/classic.ts +++ b/src/service-override/configuration/classic.ts @@ -1,118 +1,35 @@ -import { VSBuffer } from 'vs/base/common/buffer' -import type { IDisposable } from 'vs/base/common/lifecycle' -import { Schemas } from 'vs/base/common/network' -import { URI } from 'vs/base/common/uri' -import { generateUuid } from 'vs/base/common/uuid' -import { - ITextResourceConfigurationService, - ITextResourcePropertiesService -} from 'vs/editor/common/services/textResourceConfiguration.service' -import { TextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService' import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import getCommonServiceOverride, { + type IAnyWorkspaceIdentifier, + type IStoredWorkspace, + type IWorkspaceIdentifier +} from './common' +import { URI } from 'vs/base/common/uri' import { IConfigurationService } from 'vs/platform/configuration/common/configuration.service' -import { - Extensions as ConfigurationExtensions, - ConfigurationScope, - type IConfigurationDefaults, - type IConfigurationNode, - type IConfigurationRegistry -} from 'vs/platform/configuration/common/configurationRegistry' -import type { IFileWriteOptions } from 'vs/platform/files/common/files' -import { IFileService } from 'vs/platform/files/common/files.service' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' -import { ILogService } from 'vs/platform/log/common/log.service' -import { IPolicyService } from 'vs/platform/policy/common/policy.service' -import { Registry } from 'vs/platform/registry/common/platform' -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity.service' -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile.service' -import type { - IAnyWorkspaceIdentifier, - IEmptyWorkspaceIdentifier, - ISingleFolderWorkspaceIdentifier, - IWorkspaceIdentifier -} from 'vs/platform/workspace/common/workspace' import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace.service' -import type { - IStoredWorkspace, - IWorkspaceFolderCreationData -} from 'vs/platform/workspaces/common/workspaces' -import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces.service' -import 'vs/workbench/api/common/configurationExtensionPoint' -import 'vs/workbench/contrib/workspaces/browser/workspaces.contribution' -import { WorkspaceService } from 'vs/workbench/services/configuration/browser/configurationService' -import { ConfigurationCache } from 'vs/workbench/services/configuration/common/configurationCache' -import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService.service' +import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing.service' +import { memoizedConstructor, unsupported } from '../../tools' +import { getService } from '../../services' +import { generateUuid } from 'vs/base/common/uuid' +import type { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService.service' import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService.service' -import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService.service' -import { TextResourcePropertiesService } from 'vs/workbench/services/textresourceProperties/common/textResourcePropertiesService' -import type { - IColorCustomizations, - IThemeScopedColorCustomizations -} from 'vs/workbench/services/themes/common/workbenchThemeService' import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile.service' import { AbstractWorkspaceEditingService } from 'vs/workbench/services/workspaces/browser/abstractWorkspaceEditingService' -import { BrowserWorkspacesService } from 'vs/workbench/services/workspaces/browser/workspacesService' -import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing.service' -import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/browser/configurationResolverService' -import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver.service' -import getFileServiceOverride, { initFile } from '../files' -import { registerServiceInitializePreParticipant } from '../../lifecycle' -import { getService, withReadyServices } from '../../services' -import { memoizedConstructor, unsupported } from '../../tools' +import { IRemoteAgentService } from 'vs/workbench/services/remote/common/remoteAgentService.service' +import { WorkspaceService } from 'vs/workbench/services/configuration/browser/configurationService' +import { ConfigurationCache } from 'vs/workbench/services/configuration/common/configurationCache' +import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile.service' +import { IFileService } from 'vs/platform/files/common/files.service' +import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity.service' +import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' +import { ILogService } from 'vs/platform/log/common/log.service' +import { IPolicyService } from 'vs/platform/policy/common/policy.service' +import { Schemas } from 'vs/base/common/network' import { getWorkbenchConstructionOptions, getWorkspaceIdentifier } from '../../workbench' - -// This is the default value, but can be overriden by overriding the Environment or UserDataProfileService service -const defaultUserConfigurationFile = URI.from({ - scheme: Schemas.vscodeUserData, - path: '/User/settings.json' -}) - -/** - * Should be called only BEFORE the service are initialized to initialize the file on the filesystem before the configuration service initializes - */ -async function initUserConfiguration( - configurationJson: string, - options?: Partial, - file: URI = defaultUserConfigurationFile -): Promise { - await initFile(file, configurationJson, options) -} - -/** - * Can be called at any time after the services are initialized to update the user configuration - */ -async function updateUserConfiguration(configurationJson: string): Promise { - const userDataProfilesService = await getService(IUserDataProfilesService) - const fileService = await getService(IFileService) - await fileService.writeFile( - userDataProfilesService.defaultProfile.settingsResource, - VSBuffer.fromString(configurationJson) - ) -} - -async function getUserConfiguration(): Promise { - const userDataProfilesService = await getService(IUserDataProfilesService) - const fileService = await getService(IFileService) - return ( - await fileService.readFile(userDataProfilesService.defaultProfile.settingsResource) - ).value.toString() -} - -function onUserConfigurationChange(callback: () => void): IDisposable { - return withReadyServices((accessor) => { - const userDataProfilesService = accessor.get(IUserDataProfilesService) - return accessor.get(IFileService).onDidFilesChange((e) => { - if (e.affects(userDataProfilesService.defaultProfile.settingsResource)) { - callback() - } - }) - }) -} - -const configurationRegistry = Registry.as( - ConfigurationExtensions.Configuration -) +import { registerServiceInitializePreParticipant } from '../../lifecycle' +import { VSBuffer } from 'vs/base/common/buffer' +export * from './common' class InjectedConfigurationService extends WorkspaceService { constructor( @@ -209,7 +126,7 @@ function getServiceOverride( _defaultWorkspace = defaultWorkspace return { - ...getFileServiceOverride(), + ...getCommonServiceOverride(), [IConfigurationService.toString()]: new SyncDescriptor( MemoizedInjectedConfigurationService, [], @@ -220,50 +137,12 @@ function getServiceOverride( [], true ), - [ITextResourceConfigurationService.toString()]: new SyncDescriptor( - TextResourceConfigurationService, - [], - true - ), [IWorkspaceEditingService.toString()]: new SyncDescriptor( MonacoWorkspaceEditingService, [], true - ), - [IWorkspacesService.toString()]: new SyncDescriptor(BrowserWorkspacesService, [], true), - [ITextResourcePropertiesService.toString()]: new SyncDescriptor( - TextResourcePropertiesService, - [], - true - ), - [IConfigurationResolverService.toString()]: new SyncDescriptor( - ConfigurationResolverService, - [], - true ) } } export default getServiceOverride - -export { - ConfigurationScope, - configurationRegistry, - defaultUserConfigurationFile, - getUserConfiguration, - initUserConfiguration, - onUserConfigurationChange, - updateUserConfiguration -} -export type { - IAnyWorkspaceIdentifier, - IColorCustomizations, - IConfigurationDefaults, - IConfigurationNode, - IEmptyWorkspaceIdentifier, - ISingleFolderWorkspaceIdentifier, - IStoredWorkspace, - IThemeScopedColorCustomizations, - IWorkspaceFolderCreationData, - IWorkspaceIdentifier -} diff --git a/src/service-override/configuration/common.ts b/src/service-override/configuration/common.ts new file mode 100644 index 00000000..a69df050 --- /dev/null +++ b/src/service-override/configuration/common.ts @@ -0,0 +1,141 @@ +import { VSBuffer } from 'vs/base/common/buffer' +import type { IDisposable } from 'vs/base/common/lifecycle' +import { Schemas } from 'vs/base/common/network' +import { URI } from 'vs/base/common/uri' +import { + ITextResourceConfigurationService, + ITextResourcePropertiesService +} from 'vs/editor/common/services/textResourceConfiguration.service' +import { TextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService' +import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import { + Extensions as ConfigurationExtensions, + ConfigurationScope, + type IConfigurationDefaults, + type IConfigurationNode, + type IConfigurationRegistry +} from 'vs/platform/configuration/common/configurationRegistry' +import type { IFileWriteOptions } from 'vs/platform/files/common/files' +import { IFileService } from 'vs/platform/files/common/files.service' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +import { Registry } from 'vs/platform/registry/common/platform' +import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile.service' +import type { + IAnyWorkspaceIdentifier, + IEmptyWorkspaceIdentifier, + ISingleFolderWorkspaceIdentifier, + IWorkspaceIdentifier +} from 'vs/platform/workspace/common/workspace' +import type { + IStoredWorkspace, + IWorkspaceFolderCreationData +} from 'vs/platform/workspaces/common/workspaces' +import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces.service' +import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/browser/configurationResolverService' +import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver.service' +import { TextResourcePropertiesService } from 'vs/workbench/services/textresourceProperties/common/textResourcePropertiesService' +import type { + IColorCustomizations, + IThemeScopedColorCustomizations +} from 'vs/workbench/services/themes/common/workbenchThemeService' +import { BrowserWorkspacesService } from 'vs/workbench/services/workspaces/browser/workspacesService' +import { getService, withReadyServices } from '../../services' +import getFileServiceOverride, { initFile } from '../files' +import 'vs/workbench/api/common/configurationExtensionPoint' +import 'vs/workbench/contrib/workspaces/browser/workspaces.contribution' + +// This is the default value, but can be overriden by overriding the Environment or UserDataProfileService service +const defaultUserConfigurationFile = URI.from({ + scheme: Schemas.vscodeUserData, + path: '/User/settings.json' +}) + +/** + * Should be called only BEFORE the service are initialized to initialize the file on the filesystem before the configuration service initializes + */ +async function initUserConfiguration( + configurationJson: string, + options?: Partial, + file: URI = defaultUserConfigurationFile +): Promise { + await initFile(file, configurationJson, options) +} + +/** + * Can be called at any time after the services are initialized to update the user configuration + */ +async function updateUserConfiguration(configurationJson: string): Promise { + const userDataProfilesService = await getService(IUserDataProfilesService) + const fileService = await getService(IFileService) + await fileService.writeFile( + userDataProfilesService.defaultProfile.settingsResource, + VSBuffer.fromString(configurationJson) + ) +} + +async function getUserConfiguration(): Promise { + const userDataProfilesService = await getService(IUserDataProfilesService) + const fileService = await getService(IFileService) + return ( + await fileService.readFile(userDataProfilesService.defaultProfile.settingsResource) + ).value.toString() +} + +function onUserConfigurationChange(callback: () => void): IDisposable { + return withReadyServices((accessor) => { + const userDataProfilesService = accessor.get(IUserDataProfilesService) + return accessor.get(IFileService).onDidFilesChange((e) => { + if (e.affects(userDataProfilesService.defaultProfile.settingsResource)) { + callback() + } + }) + }) +} + +const configurationRegistry = Registry.as( + ConfigurationExtensions.Configuration +) + +export default function getServiceOverride(): IEditorOverrideServices { + return { + ...getFileServiceOverride(), + [ITextResourceConfigurationService.toString()]: new SyncDescriptor( + TextResourceConfigurationService, + [], + true + ), + [IWorkspacesService.toString()]: new SyncDescriptor(BrowserWorkspacesService, [], true), + [ITextResourcePropertiesService.toString()]: new SyncDescriptor( + TextResourcePropertiesService, + [], + true + ), + [IConfigurationResolverService.toString()]: new SyncDescriptor( + ConfigurationResolverService, + [], + true + ) + } +} + +export { + configurationRegistry, + ConfigurationScope, + defaultUserConfigurationFile, + getUserConfiguration, + initUserConfiguration, + onUserConfigurationChange, + updateUserConfiguration +} +export type { + IAnyWorkspaceIdentifier, + IColorCustomizations, + IConfigurationDefaults, + IConfigurationNode, + IEmptyWorkspaceIdentifier, + ISingleFolderWorkspaceIdentifier, + IStoredWorkspace, + IThemeScopedColorCustomizations, + IWorkspaceFolderCreationData, + IWorkspaceIdentifier +} diff --git a/src/service-override/configuration/session.ts b/src/service-override/configuration/session.ts index 1ae7baf1..931ea4b8 100644 --- a/src/service-override/configuration/session.ts +++ b/src/service-override/configuration/session.ts @@ -1,121 +1,28 @@ -import { VSBuffer } from 'vs/base/common/buffer' -import type { IDisposable } from 'vs/base/common/lifecycle' -import { Schemas } from 'vs/base/common/network' -import { URI } from 'vs/base/common/uri' -import { - ITextResourceConfigurationService, - ITextResourcePropertiesService -} from 'vs/editor/common/services/textResourceConfiguration.service' -import { TextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService' import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' +import getCommonServiceOverride from './common' import { IConfigurationService } from 'vs/platform/configuration/common/configuration.service' -import { - Extensions as ConfigurationExtensions, - ConfigurationScope, - type IConfigurationDefaults, - type IConfigurationNode, - type IConfigurationRegistry -} from 'vs/platform/configuration/common/configurationRegistry' -import type { IFileWriteOptions } from 'vs/platform/files/common/files' -import { IFileService } from 'vs/platform/files/common/files.service' -import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { IPolicyService } from 'vs/platform/policy/common/policy.service' -import { Registry } from 'vs/platform/registry/common/platform' -import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity.service' -import { IUserDataProfilesService } from 'vs/platform/userDataProfile/common/userDataProfile.service' -import { - isWorkspaceIdentifier, - type IAnyWorkspaceIdentifier, - type IEmptyWorkspaceIdentifier, - type ISingleFolderWorkspaceIdentifier, - type IWorkspaceIdentifier -} from 'vs/platform/workspace/common/workspace' +import { SessionsWorkspaceContextService } from 'vs/sessions/services/workspace/browser/workspaceContextService' import { IWorkspaceContextService } from 'vs/platform/workspace/common/workspace.service' -import type { - IStoredWorkspace, - IWorkspaceFolderCreationData -} from 'vs/platform/workspaces/common/workspaces' -import { IWorkspacesService } from 'vs/platform/workspaces/common/workspaces.service' -import 'vs/workbench/api/common/configurationExtensionPoint' -import 'vs/workbench/contrib/workspaces/browser/workspaces.contribution' import { IBrowserWorkbenchEnvironmentService } from 'vs/workbench/services/environment/browser/environmentService.service' -import { TextResourcePropertiesService } from 'vs/workbench/services/textresourceProperties/common/textResourcePropertiesService' -import type { - IColorCustomizations, - IThemeScopedColorCustomizations -} from 'vs/workbench/services/themes/common/workbenchThemeService' -import { BrowserWorkspacesService } from 'vs/workbench/services/workspaces/browser/workspacesService' -import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing.service' -import { ConfigurationResolverService } from 'vs/workbench/services/configurationResolver/browser/configurationResolverService' -import { IConfigurationResolverService } from 'vs/workbench/services/configurationResolver/common/configurationResolver.service' -import getFileServiceOverride, { initFile } from '../files' -import { getService, withReadyServices } from '../../services' -import { memoizedConstructor } from '../../tools' -import { SessionsWorkspaceContextService } from 'vs/sessions/services/workspace/browser/workspaceContextService' +import { IUriIdentityService } from 'vs/platform/uriIdentity/common/uriIdentity.service' import { getWorkspaceIdentifier } from '../../workbench' +import { isWorkspaceIdentifier } from 'vs/platform/workspace/common/workspace' +import { memoizedConstructor } from '../../tools' +import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile.service' +import { IFileService } from 'vs/platform/files/common/files.service' +import { IPolicyService } from 'vs/platform/policy/common/policy.service' +import { ConfigurationCache } from 'vs/workbench/services/configuration/common/configurationCache' import { ILogService } from 'vs/platform/log/common/log.service' +import { Schemas } from 'vs/base/common/network' import { ConfigurationService } from 'vs/sessions/services/configuration/browser/configurationService' -import { ConfigurationCache } from 'vs/workbench/services/configuration/common/configurationCache' -import { IUserDataProfileService } from 'vs/workbench/services/userDataProfile/common/userDataProfile.service' +import { IWorkspaceEditingService } from 'vs/workbench/services/workspaces/common/workspaceEditing.service' +import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' +export * from './common' import 'vs/sessions/contrib/configuration/browser/configuration.contribution' - -// This is the default value, but can be overriden by overriding the Environment or UserDataProfileService service -const defaultUserConfigurationFile = URI.from({ - scheme: Schemas.vscodeUserData, - path: '/User/settings.json' -}) - -/** - * Should be called only BEFORE the service are initialized to initialize the file on the filesystem before the configuration service initializes - */ -async function initUserConfiguration( - configurationJson: string, - options?: Partial, - file: URI = defaultUserConfigurationFile -): Promise { - await initFile(file, configurationJson, options) -} - -/** - * Can be called at any time after the services are initialized to update the user configuration - */ -async function updateUserConfiguration(configurationJson: string): Promise { - const userDataProfilesService = await getService(IUserDataProfilesService) - const fileService = await getService(IFileService) - await fileService.writeFile( - userDataProfilesService.defaultProfile.settingsResource, - VSBuffer.fromString(configurationJson) - ) -} - -async function getUserConfiguration(): Promise { - const userDataProfilesService = await getService(IUserDataProfilesService) - const fileService = await getService(IFileService) - return ( - await fileService.readFile(userDataProfilesService.defaultProfile.settingsResource) - ).value.toString() -} - -function onUserConfigurationChange(callback: () => void): IDisposable { - return withReadyServices((accessor) => { - const userDataProfilesService = accessor.get(IUserDataProfilesService) - return accessor.get(IFileService).onDidFilesChange((e) => { - if (e.affects(userDataProfilesService.defaultProfile.settingsResource)) { - callback() - } - }) - }) -} - -const configurationRegistry = Registry.as( - ConfigurationExtensions.Configuration -) +import { registerServiceInitializePreParticipant } from '../../lifecycle' class InjectedSessionsWorkspaceContextService extends SessionsWorkspaceContextService { - constructor( - @IBrowserWorkbenchEnvironmentService environmentService: IBrowserWorkbenchEnvironmentService, - @IUriIdentityService uriIdentityService: IUriIdentityService - ) { + constructor(@IUriIdentityService uriIdentityService: IUriIdentityService) { const workspaceIdentifier = getWorkspaceIdentifier() if (!isWorkspaceIdentifier(workspaceIdentifier)) { throw new Error( @@ -159,9 +66,13 @@ class InjectedConfigurationService extends ConfigurationService { } } -function getServiceOverride(): IEditorOverrideServices { +registerServiceInitializePreParticipant(async (accessor) => { + await (accessor.get(IConfigurationService) as ConfigurationService).initialize() +}) + +export default function getServiceOverride(): IEditorOverrideServices { return { - ...getFileServiceOverride(), + ...getCommonServiceOverride(), [IConfigurationService.toString()]: new SyncDescriptor(InjectedConfigurationService, [], true), [IWorkspaceContextService.toString()]: new SyncDescriptor( MemoizedInjectedSessionsWorkspaceContextService, @@ -172,47 +83,6 @@ function getServiceOverride(): IEditorOverrideServices { MemoizedInjectedSessionsWorkspaceContextService, [], true - ), - [ITextResourceConfigurationService.toString()]: new SyncDescriptor( - TextResourceConfigurationService, - [], - true - ), - - [IWorkspacesService.toString()]: new SyncDescriptor(BrowserWorkspacesService, [], true), - [ITextResourcePropertiesService.toString()]: new SyncDescriptor( - TextResourcePropertiesService, - [], - true - ), - [IConfigurationResolverService.toString()]: new SyncDescriptor( - ConfigurationResolverService, - [], - true ) } } - -export default getServiceOverride - -export { - ConfigurationScope, - configurationRegistry, - defaultUserConfigurationFile, - getUserConfiguration, - initUserConfiguration, - onUserConfigurationChange, - updateUserConfiguration -} -export type { - IAnyWorkspaceIdentifier, - IColorCustomizations, - IConfigurationDefaults, - IConfigurationNode, - IEmptyWorkspaceIdentifier, - ISingleFolderWorkspaceIdentifier, - IStoredWorkspace, - IThemeScopedColorCustomizations, - IWorkspaceFolderCreationData, - IWorkspaceIdentifier -} diff --git a/src/service-override/mcp/common.ts b/src/service-override/mcp/common.ts index 75b99ca5..1acffc43 100644 --- a/src/service-override/mcp/common.ts +++ b/src/service-override/mcp/common.ts @@ -34,6 +34,9 @@ import { IWorkbenchMcpManagementService } from 'vs/workbench/services/mcp/common import { McpSandboxService } from 'vs/workbench/contrib/mcp/common/mcpSandboxService' import { IWorkbenchMcpGatewayService } from 'vs/workbench/contrib/mcp/common/mcpGatewayService.service' import { BrowserMcpGatewayService } from 'vs/workbench/contrib/mcp/browser/mcpGatewayService' +import { IMcpDevModeDebugging } from 'vs/workbench/contrib/mcp/common/mcpDevMode.service.js' +import { McpDevModeDebugging } from 'vs/workbench/contrib/mcp/common/mcpDevMode.js' +import 'vs/workbench/contrib/mcp/common/mcpDevMode.js' import 'vs/workbench/contrib/mcp/browser/mcp.contribution' import 'vs/workbench/api/browser/extensionHost.mcp.contribution' @@ -73,6 +76,11 @@ export default function getServiceOverride(): IEditorOverrideServices { true ), [IMcpSandboxService.toString()]: new SyncDescriptor(McpSandboxService, [], true), - [IWorkbenchMcpGatewayService.toString()]: new SyncDescriptor(BrowserMcpGatewayService, [], true) + [IWorkbenchMcpGatewayService.toString()]: new SyncDescriptor( + BrowserMcpGatewayService, + [], + true + ), + [IMcpDevModeDebugging.toString()]: new SyncDescriptor(McpDevModeDebugging, [], true) } } diff --git a/src/service-override/viewCommon/classic.ts b/src/service-override/viewCommon/classic.ts index 2156c3a3..1144b55c 100644 --- a/src/service-override/viewCommon/classic.ts +++ b/src/service-override/viewCommon/classic.ts @@ -5,9 +5,10 @@ import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/b import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { IDiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService.service' import { DiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService' +import getBulkEditServiceOverride from '../bulkEdit/classic.js' +// Import it from here to force the bundler to put it in this service-override package +import 'vs/workbench/browser/parts/editor/editorParts' import 'vs/workbench/contrib/modernUI/browser/modernUI.contribution' -import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service' -import { EditorService } from 'vs/workbench/services/editor/browser/editorService' export default function getServiceOverride( _webviewIframeAlternateDomains?: string @@ -20,6 +21,6 @@ export default function getServiceOverride( [], true ), - [IEditorService.toString()]: new SyncDescriptor(EditorService, [undefined], false) + ...getBulkEditServiceOverride() } } diff --git a/src/service-override/viewCommon/common.ts b/src/service-override/viewCommon/common.ts index 5786bb27..db2f09b9 100644 --- a/src/service-override/viewCommon/common.ts +++ b/src/service-override/viewCommon/common.ts @@ -41,7 +41,6 @@ import { IViewsService } from 'vs/workbench/services/views/common/viewsService.s import { registerAssets } from '../../assets.js' import { registerServiceInitializePostParticipant } from '../../lifecycle.js' -import getBulkEditServiceOverride from '../bulkEdit/classic.js' import { changeUrlDomain } from '../tools/url.js' import '../tools/editorAssets.js' import 'vs/sessions/common/theme' @@ -75,10 +74,10 @@ import 'vs/workbench/contrib/webview/browser/webview.contribution' import 'vs/workbench/contrib/webviewPanel/browser/webviewPanel.contribution' import 'vscode/src/vs/workbench/browser/parts/views/media/views.css' -// Import it from here to force the bundler to put it in this service-override package -import 'vs/workbench/browser/parts/editor/editorParts' import { ISplashStorageService } from 'vs/workbench/contrib/splash/browser/splash.service.js' import type { IPartsSplash } from 'vs/platform/theme/common/themeService.js' +import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service.js' +import { EditorService } from 'vs/workbench/services/editor/browser/editorService.js' let webviewIframeAlternateDomains: string | undefined registerAssets({ @@ -109,7 +108,6 @@ function getServiceOverride(_webviewIframeAlternateDomains?: string): IEditorOve } return { - ...getBulkEditServiceOverride(), [IViewsService.toString()]: new SyncDescriptor(ViewsService, [], false), [IViewDescriptorService.toString()]: new SyncDescriptor(ViewDescriptorService, [], true), [IActivityService.toString()]: new SyncDescriptor(ActivityService, [], true), @@ -153,7 +151,8 @@ function getServiceOverride(_webviewIframeAlternateDomains?: string): IEditorOve }, [], true - ) + ), + [IEditorService.toString()]: new SyncDescriptor(EditorService, [undefined], false) } } diff --git a/src/service-override/viewCommon/session.ts b/src/service-override/viewCommon/session.ts index cf871d17..13d92577 100644 --- a/src/service-override/viewCommon/session.ts +++ b/src/service-override/viewCommon/session.ts @@ -1,12 +1,11 @@ import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' -import getCommonServiceOverride from './common' -import { AgenticPaneCompositePartService } from 'vs/sessions/browser/paneCompositePartService' import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' -import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite.service' -import { IDiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService.service' +import { AgenticPaneCompositePartService } from 'vs/sessions/browser/paneCompositePartService' import { SessionsDiffEditorCommandsService } from 'vs/sessions/contrib/editor/browser/diffEditor.sessions.contribution' -import { IEditorService } from 'vs/workbench/services/editor/common/editorService.service' -import { EditorParts } from 'vs/sessions/browser/parts/editorParts' +import { IDiffEditorCommandsService } from 'vs/workbench/browser/parts/editor/diffEditorCommandsService.service' +import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite.service' +import getBulkEditServiceOverride from '../bulkEdit/session.js' +import getCommonServiceOverride from './common' export default function getServiceOverride( _webviewIframeAlternateDomains?: string @@ -23,6 +22,6 @@ export default function getServiceOverride( [], true ), - [IEditorService.toString()]: new SyncDescriptor(EditorParts, [], true) + ...getBulkEditServiceOverride() } } diff --git a/src/service-override/workbench/classic.ts b/src/service-override/workbench/classic.ts index 95f460a8..3f5bf536 100644 --- a/src/service-override/workbench/classic.ts +++ b/src/service-override/workbench/classic.ts @@ -7,10 +7,8 @@ import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection' import { ILogService } from 'vs/platform/log/common/log.service' -import { EditorParts } from 'vs/workbench/browser/parts/editor/editorParts' import { BrowserWindow } from 'vs/workbench/browser/window' import { type IWorkbenchOptions, Workbench } from 'vs/workbench/browser/workbench' -import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService.service' import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService.service' import { WorkspaceFolderLabelService } from 'vs/workbench/services/workspaces/common/workspaceFolderLabelService' import { IWorkspaceFolderLabelService } from 'vs/workbench/services/workspaces/common/workspaceFolderLabelService.service' @@ -20,11 +18,13 @@ import getBannerServiceOverride from '../viewBanner' import getViewCommonServiceOverride from '../viewCommon/classic' import getStatusBarServiceOverride from '../viewStatusBar' import getTitleBarServiceOverride from '../viewTitleBar/classic' +import { EditorParts } from 'vs/workbench/browser/parts/editor/editorParts' +import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService.service' import getCommonServiceOverride from './common' +export * from './common' import 'vs/workbench/browser/parts/titlebar/menubar.contribution' import 'vs/workbench/browser/workbench.zenMode.contribution' import 'vs/workbench/contrib/languageStatus/browser/languageStatus.contribution' -export * from '../tools/views' class CustomWorkbench extends Workbench { constructor( diff --git a/src/service-override/workbench/common.ts b/src/service-override/workbench/common.ts index 04cf20c8..6d1d0bc3 100644 --- a/src/service-override/workbench/common.ts +++ b/src/service-override/workbench/common.ts @@ -1,6 +1,7 @@ import type { IEditorOverrideServices } from 'vs/editor/standalone/browser/standaloneServices' import getQuickAccessOverride from '../quickaccess' import getKeybindingsOverride from '../keybindings' +export * from '../tools/views' export default function getServiceOverride(): IEditorOverrideServices { return { diff --git a/src/service-override/workbench/session.ts b/src/service-override/workbench/session.ts index 138b0a21..8cee8d38 100644 --- a/src/service-override/workbench/session.ts +++ b/src/service-override/workbench/session.ts @@ -110,12 +110,19 @@ import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/la import { IWorkspaceFolderLabelService } from 'vs/workbench/services/workspaces/common/workspaceFolderLabelService.service' import { onLayout, onRenderWorkbench } from '../../lifecycle' import { getWorkbenchContainer } from '../../workbench' -import getChatServiceOverride from '../chat/session' import getBannerServiceOverride from '../viewBanner' import getViewCommonServiceOverride from '../viewCommon/session' import getStatusBarServiceOverride from '../viewStatusBar' import getCommonServiceOverride from './common' -export * from '../tools/views' +import { observableFromPromise } from 'vs/base/common/observable' +import { + Extensions as WorkbenchExtensions, + type IWorkbenchContributionsRegistry +} from 'vs/workbench/common/contributions' +import { Registry } from 'vs/platform/registry/common/platform' +import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService.service' +import { EditorParts } from 'vs/sessions/browser/parts/editorParts' +export * from './common' import 'vs/sessions/browser/parts/menubar.contribution' import 'vs/sessions/browser/sessions.web.contribution' import 'vs/sessions/contrib/accountMenu/browser/account.contribution' @@ -171,12 +178,6 @@ class CustomWorkbench extends Workbench { } protected override restore(): void { - performance.measure( - 'perf: workbench create & restore', - 'code/didLoadWorkbenchMain', - 'code/didStartWorkbench' - ) - // Restore parts (open default view containers) this.restoreParts() @@ -198,6 +199,12 @@ onRenderWorkbench(async (accessor) => { accessor.get(IInstantiationService).createInstance(BrowserWindow) }) +const initialProvidersSettled = observableFromPromise( + Registry.as(WorkbenchExtensions.Workbench).whenRestored.then( + () => true + ) +).map((result) => result.value === true) + export default function getServiceOverride( options?: IWorkbenchOptions, _webviewIframeAlternateDomains?: string @@ -206,6 +213,7 @@ export default function getServiceOverride( ...getCommonServiceOverride(), ...getViewCommonServiceOverride(_webviewIframeAlternateDomains), + [IEditorGroupsService.toString()]: new SyncDescriptor(EditorParts, [], false), [IWorkbenchLayoutService.toString()]: new SyncDescriptor(CustomWorkbench, [options], false), [IWorkspaceFolderLabelService.toString()]: new SyncDescriptor( SessionsWorkspaceFolderLabelService, @@ -223,8 +231,6 @@ export default function getServiceOverride( [IMobileVisualViewport.toString()]: new SyncDescriptor(MobileVisualViewport, [], true), - ...getChatServiceOverride(), - // Specific services [IRemoteAgentHostLocationPreferenceService.toString()]: new SyncDescriptor( RemoteAgentHostLocationPreferenceService, @@ -239,7 +245,11 @@ export default function getServiceOverride( [], true ), - [IAutomationService.toString()]: new SyncDescriptor(ProviderAutomationService, [], true), + [IAutomationService.toString()]: new SyncDescriptor( + ProviderAutomationService, + [initialProvidersSettled], + true + ), [IAutomationRunner.toString()]: new SyncDescriptor(AutomationRunner, [], true), [IAutomationDialogService.toString()]: new SyncDescriptor(AutomationDialogService, [], true), [ISessionChangesService.toString()]: new SyncDescriptor(SessionChangesService, [], true), From 2bf0676b19f186ada5f055ad5e050e36012b9807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 28 Sep 2026 12:39:02 +0200 Subject: [PATCH 22/35] fix: missing contributions --- src/service-override/theme.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/service-override/theme.ts b/src/service-override/theme.ts index 6be84fd8..17d66ef9 100644 --- a/src/service-override/theme.ts +++ b/src/service-override/theme.ts @@ -8,6 +8,8 @@ import { ConfigurationTarget } from 'vs/platform/configuration/common/configurat import type { IDisposable } from 'vs/base/common/lifecycle' import getFileServiceOverride from './files' import 'vs/workbench/contrib/themes/browser/themes.contribution' +import 'vs/sessions/common/theme' +import 'vs/sessions/common/sizes' class StandaloneWorkbenchThemeService extends WorkbenchThemeService From 1acf3ce7a9f96547728f5efb23840a3bdf6b80f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 28 Sep 2026 12:39:26 +0200 Subject: [PATCH 23/35] fix: missing side effect constructor --- rollup/tools/vscode.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/rollup/tools/vscode.ts b/rollup/tools/vscode.ts index d10ce942..fc220d19 100644 --- a/rollup/tools/vscode.ts +++ b/rollup/tools/vscode.ts @@ -67,7 +67,8 @@ const SIDE_EFFECT_CONSTRUCTORS = new Set([ 'WindowIdleValue', 'TimeoutThrottledDomListener', 'FocusTracker', - 'DragAndDropObserver' + 'DragAndDropObserver', + 'RawContextKey' ]) const PURE_OR_TO_REMOVE_FUNCTIONS = new Set([...PURE_FUNCTIONS]) From 363c26a03ccb3696549a7c971ae42e6726dacf5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 28 Sep 2026 15:09:01 +0200 Subject: [PATCH 24/35] cleanup: remove a few demos --- demo/src/features/output.ts | 36 ------------------- demo/src/features/remoteExtension.ts | 11 ------ .../l10n/bundle.l10n.de.json | 3 -- .../l10n/bundle.l10n.fr.json | 3 -- .../features/remoteExtensionExample/main.js | 11 ------ .../remoteExtensionExample/package.json | 19 ---------- .../package.nls.de.json | 3 -- .../package.nls.fr.json | 3 -- .../remoteExtensionExample/package.nls.json | 3 -- demo/src/main.views.ts | 4 --- 10 files changed, 96 deletions(-) delete mode 100644 demo/src/features/output.ts delete mode 100644 demo/src/features/remoteExtension.ts delete mode 100644 demo/src/features/remoteExtensionExample/l10n/bundle.l10n.de.json delete mode 100644 demo/src/features/remoteExtensionExample/l10n/bundle.l10n.fr.json delete mode 100644 demo/src/features/remoteExtensionExample/main.js delete mode 100644 demo/src/features/remoteExtensionExample/package.json delete mode 100644 demo/src/features/remoteExtensionExample/package.nls.de.json delete mode 100644 demo/src/features/remoteExtensionExample/package.nls.fr.json delete mode 100644 demo/src/features/remoteExtensionExample/package.nls.json diff --git a/demo/src/features/output.ts b/demo/src/features/output.ts deleted file mode 100644 index 8318f9de..00000000 --- a/demo/src/features/output.ts +++ /dev/null @@ -1,36 +0,0 @@ -import { ExtensionHostKind, registerExtension } from '@codingame/monaco-vscode-api/extensions' -import { useHtmlFileSystemProvider } from '../setup.common' - -if (!useHtmlFileSystemProvider) { - const { getApi } = registerExtension( - { - name: 'outputDemo', - publisher: 'codingame', - version: '1.0.0', - engines: { - vscode: '*' - } - }, - ExtensionHostKind.LocalProcess - ) - - void getApi().then(async (vscode) => { - const fakeOutputChannel = vscode.window.createOutputChannel('Fake output') - const anotherFakeOutputChannel = vscode.window.createOutputChannel('Your code', 'javascript') - - fakeOutputChannel.append("Here's some fake output\n") - setInterval(() => { - fakeOutputChannel.append('Hello world\n') - }, 1000) - - const mainDocument = await vscode.workspace.openTextDocument( - vscode.Uri.file('/workspace/test.js') - ) - anotherFakeOutputChannel.replace(mainDocument.getText()) - vscode.workspace.onDidChangeTextDocument((e) => { - if (e.document === mainDocument && e.contentChanges.length > 0) { - anotherFakeOutputChannel.replace(e.document.getText()) - } - }) - }) -} diff --git a/demo/src/features/remoteExtension.ts b/demo/src/features/remoteExtension.ts deleted file mode 100644 index bcfcbd83..00000000 --- a/demo/src/features/remoteExtension.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { registerRemoteExtension } from '@codingame/monaco-vscode-api/extensions' - -declare global { - interface Window { - rootDirectory?: string - } -} - -if (window.rootDirectory != null) { - void registerRemoteExtension(`${window.rootDirectory}/src/features/remoteExtensionExample/`) -} diff --git a/demo/src/features/remoteExtensionExample/l10n/bundle.l10n.de.json b/demo/src/features/remoteExtensionExample/l10n/bundle.l10n.de.json deleted file mode 100644 index c450daad..00000000 --- a/demo/src/features/remoteExtensionExample/l10n/bundle.l10n.de.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Hello from remote extension running from {0}!": "Hallo von der entfernten Nebenstelle, die auf {0} lรคuft!" -} \ No newline at end of file diff --git a/demo/src/features/remoteExtensionExample/l10n/bundle.l10n.fr.json b/demo/src/features/remoteExtensionExample/l10n/bundle.l10n.fr.json deleted file mode 100644 index e8b83bb8..00000000 --- a/demo/src/features/remoteExtensionExample/l10n/bundle.l10n.fr.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "Hello from remote extension running from {0}!": "Bonjour depuis l'extension distante tournant sur {0}!" -} \ No newline at end of file diff --git a/demo/src/features/remoteExtensionExample/main.js b/demo/src/features/remoteExtensionExample/main.js deleted file mode 100644 index c08e37ef..00000000 --- a/demo/src/features/remoteExtensionExample/main.js +++ /dev/null @@ -1,11 +0,0 @@ -const vscode = require('vscode') -const os = require('os') - -vscode.commands.registerCommand('prompt-hello', () => { - void vscode.window.showInformationMessage('Hello', { - detail: vscode.l10n.t('Hello from remote extension running from {0}!', os.hostname()), - modal: true - }) -}) - -vscode.commands.executeCommand('prompt-hello') diff --git a/demo/src/features/remoteExtensionExample/package.json b/demo/src/features/remoteExtensionExample/package.json deleted file mode 100644 index d97208ba..00000000 --- a/demo/src/features/remoteExtensionExample/package.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "name": "remote_extension_example", - "publisher": "codingame", - "version": "1.0.0", - "activationEvents": ["*"], - "engines": { - "vscode": "^1.77.0" - }, - "l10n": "./l10n", - "main": "./main.js", - "browser": "./main.js", - "contributes": { - "commands": [{ - "command": "prompt-hello", - "title": "%prompt-hello%", - "category": "Custom" - }] - } - } \ No newline at end of file diff --git a/demo/src/features/remoteExtensionExample/package.nls.de.json b/demo/src/features/remoteExtensionExample/package.nls.de.json deleted file mode 100644 index 6b2030b5..00000000 --- a/demo/src/features/remoteExtensionExample/package.nls.de.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "prompt-hello": "Hallo sagen von der entfernten Nebenstelle" -} \ No newline at end of file diff --git a/demo/src/features/remoteExtensionExample/package.nls.fr.json b/demo/src/features/remoteExtensionExample/package.nls.fr.json deleted file mode 100644 index 6f334474..00000000 --- a/demo/src/features/remoteExtensionExample/package.nls.fr.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "prompt-hello": "Dire bonjour depuis l'extension distante" -} \ No newline at end of file diff --git a/demo/src/features/remoteExtensionExample/package.nls.json b/demo/src/features/remoteExtensionExample/package.nls.json deleted file mode 100644 index 1030c460..00000000 --- a/demo/src/features/remoteExtensionExample/package.nls.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "prompt-hello": "Prompt hello from remote extension" -} \ No newline at end of file diff --git a/demo/src/main.views.ts b/demo/src/main.views.ts index dbf914d3..5d28906b 100644 --- a/demo/src/main.views.ts +++ b/demo/src/main.views.ts @@ -21,10 +21,6 @@ import defaultConfiguration from './user/configuration.json?raw' import defaultKeybindings from './user/keybindings.json?raw' import './main.common' -if (remoteAuthority != null) { - void import('./features/remoteExtension') -} - document.querySelector('#customEditorPanel')!.addEventListener('click', async () => { const input = await createInstance(CustomEditorInput, undefined) let toggle = false From 5e4cb86d4f3fc9a7b2665b6923c811d5b9f3c267 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 28 Sep 2026 15:09:24 +0200 Subject: [PATCH 25/35] fix(demo): prevent error when the extension is blocked --- demo/src/features/debugger.ts | 109 ++++++++++++++++++---------------- 1 file changed, 57 insertions(+), 52 deletions(-) diff --git a/demo/src/features/debugger.ts b/demo/src/features/debugger.ts index db237ab0..9de5a20e 100644 --- a/demo/src/features/debugger.ts +++ b/demo/src/features/debugger.ts @@ -31,68 +31,73 @@ const { getApi, registerFileUrl } = registerExtension( registerFileUrl('./extension.js', 'data:text/javascript;base64,' + window.btoa('// nothing')) -void getApi().then(async (debuggerVscodeApi) => { - class WebsocketDebugAdapter implements vscode.DebugAdapter { - constructor(private websocket: WebSocket) { - websocket.onmessage = (message) => { - this._onDidSendMessage.fire(JSON.parse(message.data)) +void getApi().then( + async (debuggerVscodeApi) => { + class WebsocketDebugAdapter implements vscode.DebugAdapter { + constructor(private websocket: WebSocket) { + websocket.onmessage = (message) => { + this._onDidSendMessage.fire(JSON.parse(message.data)) + } } - } - _onDidSendMessage = new debuggerVscodeApi.EventEmitter() - onDidSendMessage = this._onDidSendMessage.event + _onDidSendMessage = new debuggerVscodeApi.EventEmitter() + onDidSendMessage = this._onDidSendMessage.event - handleMessage(message: vscode.DebugProtocolMessage): void { - this.websocket.send(JSON.stringify(message)) - } - - dispose() { - this.websocket.close() - } - } + handleMessage(message: vscode.DebugProtocolMessage): void { + this.websocket.send(JSON.stringify(message)) + } - debuggerVscodeApi.debug.registerDebugConfigurationProvider('javascript', { - resolveDebugConfiguration() { - return { - name: 'Test debugger', - type: 'javascript', - request: 'launch' + dispose() { + this.websocket.close() } } - }) - debuggerVscodeApi.debug.registerDebugAdapterDescriptorFactory('javascript', { - async createDebugAdapterDescriptor() { - const websocket = new WebSocket('ws://localhost:5555') + debuggerVscodeApi.debug.registerDebugConfigurationProvider('javascript', { + resolveDebugConfiguration() { + return { + name: 'Test debugger', + type: 'javascript', + request: 'launch' + } + } + }) - await new Promise((resolve, reject) => { - websocket.onopen = resolve - websocket.onerror = () => - reject(new Error('Unable to connect to debugger server. Run `npm run start:debugServer`')) - }) + debuggerVscodeApi.debug.registerDebugAdapterDescriptorFactory('javascript', { + async createDebugAdapterDescriptor() { + const websocket = new WebSocket('ws://localhost:5555') - websocket.send( - JSON.stringify({ - main: '/workspace/test.js', - files: { - '/workspace/test.js': new TextDecoder().decode( - await debuggerVscodeApi.workspace.fs.readFile( - debuggerVscodeApi.Uri.file('/workspace/test.js') - ) + await new Promise((resolve, reject) => { + websocket.onopen = resolve + websocket.onerror = () => + reject( + new Error('Unable to connect to debugger server. Run `npm run start:debugServer`') ) - } }) - ) - const adapter = new WebsocketDebugAdapter(websocket) + websocket.send( + JSON.stringify({ + main: '/workspace/test.js', + files: { + '/workspace/test.js': new TextDecoder().decode( + await debuggerVscodeApi.workspace.fs.readFile( + debuggerVscodeApi.Uri.file('/workspace/test.js') + ) + ) + } + }) + ) - // eslint-disable-next-line @typescript-eslint/no-explicit-any - adapter.onDidSendMessage((message: any) => { - if (message.type === 'event' && message.event === 'output') { - console.log('OUTPUT', message.body.output) - } - }) - return new debuggerVscodeApi.DebugAdapterInlineImplementation(adapter) - } - }) -}) + const adapter = new WebsocketDebugAdapter(websocket) + + // eslint-disable-next-line @typescript-eslint/no-explicit-any + adapter.onDidSendMessage((message: any) => { + if (message.type === 'event' && message.event === 'output') { + console.log('OUTPUT', message.body.output) + } + }) + return new debuggerVscodeApi.DebugAdapterInlineImplementation(adapter) + } + }) + }, + () => {} +) From 734a0c3fa41efa270aa87459a14833e5cf0c7cd5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 28 Sep 2026 16:34:10 +0200 Subject: [PATCH 26/35] fix: properly set isSessionsWindow --- src/service-override/environment.ts | 8 ++++++++ src/service-override/workbench/session.ts | 5 ++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/service-override/environment.ts b/src/service-override/environment.ts index 4b5f8a37..9ff2772b 100644 --- a/src/service-override/environment.ts +++ b/src/service-override/environment.ts @@ -17,6 +17,8 @@ export interface WorkbenchEnvironmentServiceOverrides { workspaceStorageHome?: URI localHistoryHome?: URI stateResource?: URI + isSessionsWindow?: boolean + sessionTitle?: string } class InjectedBrowserWorkbenchEnvironmentService @@ -55,6 +57,12 @@ class InjectedBrowserWorkbenchEnvironmentService override get stateResource() { return this.overrides.stateResource ?? super.stateResource } + override get isSessionsWindow() { + return this.overrides.isSessionsWindow ?? super.isSessionsWindow + } + override get sessionTitle() { + return this.overrides.sessionTitle ?? super.sessionTitle + } } function getServiceOverride( diff --git a/src/service-override/workbench/session.ts b/src/service-override/workbench/session.ts index 8cee8d38..4fb8b941 100644 --- a/src/service-override/workbench/session.ts +++ b/src/service-override/workbench/session.ts @@ -122,6 +122,7 @@ import { import { Registry } from 'vs/platform/registry/common/platform' import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService.service' import { EditorParts } from 'vs/sessions/browser/parts/editorParts' +import getEnvironmentServiceOverride from '../environment.js' export * from './common' import 'vs/sessions/browser/parts/menubar.contribution' import 'vs/sessions/browser/sessions.web.contribution' @@ -212,7 +213,9 @@ export default function getServiceOverride( return { ...getCommonServiceOverride(), ...getViewCommonServiceOverride(_webviewIframeAlternateDomains), - + ...getEnvironmentServiceOverride({ + isSessionsWindow: true + }), [IEditorGroupsService.toString()]: new SyncDescriptor(EditorParts, [], false), [IWorkbenchLayoutService.toString()]: new SyncDescriptor(CustomWorkbench, [options], false), [IWorkspaceFolderLabelService.toString()]: new SyncDescriptor( From e3380faae9dfc048eca9c9430ca1c7870bbef5c5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 28 Sep 2026 16:38:13 +0200 Subject: [PATCH 27/35] feat(demo): demo agent window --- demo/src/features/customView.workbench.ts | 2 +- demo/src/loader.ts | 55 +-- demo/src/main.common.ts | 80 +--- demo/src/main.views.ts | 2 +- ...workbench.ts => main.workbench.classic.ts} | 6 +- demo/src/main.workbench.session.ts | 16 + demo/src/setup.common.classic.ts | 314 ++++++++++++++ demo/src/setup.common.session.ts | 93 ++++ demo/src/setup.common.ts | 404 +++--------------- demo/src/setup.views.ts | 2 +- ...orkbench.ts => setup.workbench.classic.ts} | 2 +- demo/src/setup.workbench.session.ts | 93 ++++ 12 files changed, 632 insertions(+), 437 deletions(-) rename demo/src/{main.workbench.ts => main.workbench.classic.ts} (89%) create mode 100644 demo/src/main.workbench.session.ts create mode 100644 demo/src/setup.common.classic.ts create mode 100644 demo/src/setup.common.session.ts rename demo/src/{setup.workbench.ts => setup.workbench.classic.ts} (99%) create mode 100644 demo/src/setup.workbench.session.ts diff --git a/demo/src/features/customView.workbench.ts b/demo/src/features/customView.workbench.ts index 803af5e4..d8d078b0 100644 --- a/demo/src/features/customView.workbench.ts +++ b/demo/src/features/customView.workbench.ts @@ -17,7 +17,7 @@ import { SimpleEditorInput, RegisteredEditorPriority, ConfirmResult -} from '@codingame/monaco-vscode-workbench-service-override' +} from '@codingame/monaco-vscode-workbench-service-override/common' import * as monaco from 'monaco-editor' registerCustomView({ diff --git a/demo/src/loader.ts b/demo/src/loader.ts index 6d033895..f9b2d9f8 100644 --- a/demo/src/loader.ts +++ b/demo/src/loader.ts @@ -65,30 +65,33 @@ declare global { } window._VSCODE_PRODUCT_JSON = { - defaultChatAgent: { - chatExtensionId: 'codingame.aiDemo', - extensionId: '', - completionsEnablementSetting: 'codingameAICompletionsEnabled', - nextEditSuggestionsSetting: 'codingameNextEditSuggestionsEnabled', - provider: { - default: { - id: 'codingame', - name: 'Codingame' - }, - apple: { - id: 'codingame', - name: 'Codingame' - }, - enterprise: { - id: 'codingame', - name: 'Codingame' - }, - google: { - id: 'codingame', - name: 'Codingame' - } - } - } + defaultChatAgent: + mode === 'session' + ? undefined + : { + chatExtensionId: 'codingame.aiDemo', + extensionId: '', + completionsEnablementSetting: 'codingameAICompletionsEnabled', + nextEditSuggestionsSetting: 'codingameNextEditSuggestionsEnabled', + provider: { + default: { + id: 'codingame', + name: 'Codingame' + }, + apple: { + id: 'codingame', + name: 'Codingame' + }, + enterprise: { + id: 'codingame', + name: 'Codingame' + }, + google: { + id: 'codingame', + name: 'Codingame' + } + } + } } ;(async () => { if (sandboxed) { @@ -99,7 +102,9 @@ window._VSCODE_PRODUCT_JSON = { window.vscodeWindow = window.vscodeContainer.ownerDocument.defaultView! } if (mode === 'full-workbench') { - await import('./main.workbench') + await import('./main.workbench.classic') + } else if (mode === 'session') { + await import('./main.workbench.session') } else { await import('./main.views') } diff --git a/demo/src/main.common.ts b/demo/src/main.common.ts index 837eee69..54f289da 100644 --- a/demo/src/main.common.ts +++ b/demo/src/main.common.ts @@ -1,8 +1,4 @@ import './style.css' -import * as monaco from 'monaco-editor' -import { ExtensionHostKind, registerExtension } from '@codingame/monaco-vscode-api/extensions' -import { useHtmlFileSystemProvider } from './setup.common' -import './features/output' import './features/debugger' import './features/intellisense' import './features/notifications' @@ -44,6 +40,7 @@ import '@codingame/monaco-vscode-xml-default-extension' import '@codingame/monaco-vscode-yaml-default-extension' import '@codingame/monaco-vscode-theme-defaults-default-extension' import '@codingame/monaco-vscode-theme-seti-default-extension' +import '@codingame/monaco-vscode-theme-modern-icons-default-extension' import '@codingame/monaco-vscode-references-view-default-extension' import '@codingame/monaco-vscode-search-result-default-extension' import '@codingame/monaco-vscode-configuration-editing-default-extension' @@ -54,61 +51,28 @@ import '@codingame/monaco-vscode-ipynb-default-extension' import '@codingame/monaco-vscode-simple-browser-default-extension' import '@codingame/monaco-vscode-mermaid-markdown-features-default-extension' -const { getApi } = registerExtension( - { - name: 'demo-main', - publisher: 'codingame', - version: '1.0.0', - engines: { - vscode: '*' - } - }, - ExtensionHostKind.LocalProcess -) - -void getApi().then(async (vscode) => { - if (!useHtmlFileSystemProvider) { - const mainModelUri = vscode.Uri.file('/workspace/test.js') - await Promise.all([ - vscode.workspace.openTextDocument(mainModelUri), - vscode.workspace.openTextDocument(monaco.Uri.file('/workspace/test_readonly.js')) // open the file so vscode sees it's locked - ]) - - const diagnostics = vscode.languages.createDiagnosticCollection('demo') - diagnostics.set(mainModelUri, [ - { - range: new vscode.Range(2, 9, 2, 12), - severity: vscode.DiagnosticSeverity.Error, - message: "This is not a real error, just a demo, don't worry", - source: 'Demo', - code: 42 - } - ]) +document.querySelector('#toggleFullWorkbench')!.addEventListener('click', async () => { + const url = new URL(window.location.href) + if (url.searchParams.get('mode') === 'full-workbench') { + url.searchParams.delete('mode') + } else { + url.searchParams.set('mode', 'full-workbench') } + window.location.href = url.toString() +}) - document.querySelector('#toggleFullWorkbench')!.addEventListener('click', async () => { - const url = new URL(window.location.href) - if (url.searchParams.get('mode') === 'full-workbench') { - url.searchParams.delete('mode') - } else { - url.searchParams.set('mode', 'full-workbench') - } - window.location.href = url.toString() - }) - - document.querySelector('#resetLayout')!.addEventListener('click', async () => { - const url = new URL(window.location.href) - url.searchParams.set('resetLayout', 'true') - window.location.href = url.toString() - }) +document.querySelector('#resetLayout')!.addEventListener('click', async () => { + const url = new URL(window.location.href) + url.searchParams.set('resetLayout', 'true') + window.location.href = url.toString() +}) - document.querySelector('#toggleHTMLFileSystemProvider')!.addEventListener('click', async () => { - const url = new URL(window.location.href) - if (url.searchParams.has('htmlFileSystemProvider')) { - url.searchParams.delete('htmlFileSystemProvider') - } else { - url.searchParams.set('htmlFileSystemProvider', 'true') - } - window.location.href = url.toString() - }) +document.querySelector('#toggleHTMLFileSystemProvider')!.addEventListener('click', async () => { + const url = new URL(window.location.href) + if (url.searchParams.has('htmlFileSystemProvider')) { + url.searchParams.delete('htmlFileSystemProvider') + } else { + url.searchParams.set('htmlFileSystemProvider', 'true') + } + window.location.href = url.toString() }) diff --git a/demo/src/main.views.ts b/demo/src/main.views.ts index 5d28906b..5a6dc0f7 100644 --- a/demo/src/main.views.ts +++ b/demo/src/main.views.ts @@ -15,7 +15,7 @@ import { defaultUserKeybindindsFile, updateUserKeybindings } from '@codingame/monaco-vscode-keybindings-service-override' -import { clearStorage, remoteAuthority } from './setup.views' +import { clearStorage } from './setup.views' import { CustomEditorInput } from './features/customView.views' import defaultConfiguration from './user/configuration.json?raw' import defaultKeybindings from './user/keybindings.json?raw' diff --git a/demo/src/main.workbench.ts b/demo/src/main.workbench.classic.ts similarity index 89% rename from demo/src/main.workbench.ts rename to demo/src/main.workbench.classic.ts index 9636b0d6..e1641ce3 100644 --- a/demo/src/main.workbench.ts +++ b/demo/src/main.workbench.classic.ts @@ -1,12 +1,8 @@ import { IEditorService, StandaloneServices, createInstance } from '@codingame/monaco-vscode-api' -import { clearStorage, remoteAuthority } from './setup.workbench' +import { clearStorage } from './setup.workbench.classic' import { CustomEditorInput } from './features/customView.workbench' import './main.common' -if (remoteAuthority != null) { - void import('./features/remoteExtension') -} - document.querySelector('#customEditorPanel')!.addEventListener('click', async () => { const input = await createInstance(CustomEditorInput, undefined) let toggle = false diff --git a/demo/src/main.workbench.session.ts b/demo/src/main.workbench.session.ts new file mode 100644 index 00000000..9284fcb2 --- /dev/null +++ b/demo/src/main.workbench.session.ts @@ -0,0 +1,16 @@ +import { clearStorage } from './setup.workbench.session' +import './main.common' + +document.querySelector('#clearStorage')!.addEventListener('click', async () => { + await clearStorage() +}) + +document.querySelector('#toggleShadowDom')!.addEventListener('click', async () => { + const url = new URL(window.location.href) + if (url.searchParams.has('disableShadowDom')) { + url.searchParams.delete('disableShadowDom') + } else { + url.searchParams.set('disableShadowDom', 'true') + } + window.location.href = url.toString() +}) diff --git a/demo/src/setup.common.classic.ts b/demo/src/setup.common.classic.ts new file mode 100644 index 00000000..d24f5635 --- /dev/null +++ b/demo/src/setup.common.classic.ts @@ -0,0 +1,314 @@ +export * from './setup.common' +import { IEditorOverrideServices, IWorkspace } from '@codingame/monaco-vscode-api' +import { + commonServices as _commonService, + constructOptions as _constructOptions, + remoteAuthority, + params +} from './setup.common' +import getOutlineServiceOverride from '@codingame/monaco-vscode-outline-service-override' +import getSnippetServiceOverride from '@codingame/monaco-vscode-snippets-service-override' +import getSearchServiceOverride from '@codingame/monaco-vscode-search-service-override' +import getChatServiceOverride from '@codingame/monaco-vscode-chat-service-override' +import getWelcomeServiceOverride from '@codingame/monaco-vscode-welcome-service-override' +import getWalkThroughServiceOverride from '@codingame/monaco-vscode-walkthrough-service-override' +import getUserDataSyncServiceOverride from '@codingame/monaco-vscode-user-data-sync-service-override' +import getTelemetryServiceOverride from '@codingame/monaco-vscode-telemetry-service-override' +import getMcpServiceOverride from '@codingame/monaco-vscode-mcp-service-override' +import getMeteredConnectionServiceOverride from '@codingame/monaco-vscode-metered-connection-service-override' +import getConfigurationServiceOverride, { + IStoredWorkspace +} from '@codingame/monaco-vscode-configuration-service-override' +import getDialogsServiceOverride from '@codingame/monaco-vscode-dialogs-service-override' +import getExtensionGalleryServiceOverride from '@codingame/monaco-vscode-extension-gallery-service-override' +import getDebugServiceOverride from '@codingame/monaco-vscode-debug-service-override' +import getMarkersServiceOverride from '@codingame/monaco-vscode-markers-service-override' +import getTestingServiceOverride from '@codingame/monaco-vscode-testing-service-override' +import getTimelineServiceOverride from '@codingame/monaco-vscode-timeline-service-override' +import getGithubServiceOverride from '@codingame/monaco-vscode-github-service-override' +import getTitleBarServiceOverride from '@codingame/monaco-vscode-view-title-bar-service-override' +import { + createHTMLFileSystemProvider, + initFile, + RegisteredFileSystemProvider, + RegisteredMemoryFile, + RegisteredReadOnlyFile, + registerFileSystemOverlay, + registerHTMLFileSystemProvider +} from '@codingame/monaco-vscode-files-service-override' +import * as vscode from 'vscode' + +export const remotePath = + remoteAuthority != null ? (params.get('remotePath') ?? undefined) : undefined +const workspaceFile = vscode.Uri.file('/workspace.code-workspace') +export const useHtmlFileSystemProvider = params.has('htmlFileSystemProvider') +export const resetLayout = params.has('resetLayout') +params.delete('resetLayout') +let workspace: IWorkspace = { + workspaceUri: workspaceFile +} + +if (useHtmlFileSystemProvider) { + const workspaceFile = vscode.Uri.from({ scheme: 'tmp', path: '/test.code-workspace' }) + await initFile( + workspaceFile, + JSON.stringify( + { + folders: [] + }, + null, + 2 + ) + ) + workspace = { + workspaceUri: workspaceFile + } + registerHTMLFileSystemProvider() +} else { + const fileSystemProvider = new RegisteredFileSystemProvider(false) + + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + vscode.Uri.file('/workspace/test.js'), + `// import anotherfile +let variable = 1 +function inc () { + variable++ +} + +while (variable < 5000) { + inc() + console.log('Hello world', variable); +}` + ) + ) + + const content = new TextEncoder().encode('This is a readonly static file') + fileSystemProvider.registerFile( + new RegisteredReadOnlyFile( + vscode.Uri.file('/workspace/test_readonly.js'), + async () => content, + content.length + ) + ) + + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + vscode.Uri.file('/workspace/jsconfig.json'), + `{ + "compilerOptions": { + "target": "es2020", + "module": "esnext", + "lib": [ + "es2021", + "DOM" + ] + } +}` + ) + ) + + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + vscode.Uri.file('/workspace/index.html'), + ` + + + + + monaco-vscode-api demo + + + + + +

Hello, world!

+ +` + ) + ) + + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + vscode.Uri.file('/workspace/test.md'), + ` +***Hello World*** + +Math block: +$$ +\\displaystyle +\\left( \\sum_{k=1}^n a_k b_k \\right)^2 +\\leq +\\left( \\sum_{k=1}^n a_k^2 \\right) +\\left( \\sum_{k=1}^n b_k^2 \\right) +$$ + +# Easy Math + +2 + 2 = 4 // this test will pass +2 + 2 = 5 // this test will fail + +# Harder Math + +230230 + 5819123 = 6049353 +` + ) + ) + + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + vscode.Uri.file('/workspace/test.customeditor'), + ` +Custom Editor!` + ) + ) + + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + vscode.Uri.file('/workspace/test.css'), + ` +h1 { + color: DeepSkyBlue; +}` + ) + ) + + // Use a workspace file to be able to add another folder later (for the "Attach filesystem" button) + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + workspaceFile, + JSON.stringify( + { + folders: [ + { + path: '/workspace' + } + ] + }, + null, + 2 + ) + ) + ) + workspace = { + workspaceUri: workspaceFile + } + + fileSystemProvider.registerFile( + new RegisteredMemoryFile( + vscode.Uri.file('/workspace/.vscode/extensions.json'), + JSON.stringify( + { + recommendations: ['vscodevim.vim'] + }, + null, + 2 + ) + ) + ) + + registerFileSystemOverlay(1, fileSystemProvider) + + const htmlFileProvider = createHTMLFileSystemProvider() + htmlFileProvider.registerDirectoryHandle( + await (await navigator.storage.getDirectory()).getDirectoryHandle('workspace', { create: true }) + ) + registerFileSystemOverlay(2, htmlFileProvider) +} + +export const constructOptions = { + ..._constructOptions, + workspaceProvider: { + trusted: true, + async open() { + window.open(window.location.href) + return true + }, + workspace: + remotePath == null + ? workspace + : { + folderUri: vscode.Uri.from({ + scheme: 'vscode-remote', + path: remotePath, + authority: remoteAuthority + }) + } + }, + defaultLayout: { + editors: useHtmlFileSystemProvider + ? undefined + : [ + { + uri: vscode.Uri.file('/workspace/test.js'), + viewColumn: 1 + }, + { + uri: vscode.Uri.file('/workspace/test.md'), + viewColumn: 2 + } + ], + layout: useHtmlFileSystemProvider + ? undefined + : { + editors: { + orientation: 0, + groups: [{ size: 1 }, { size: 1 }] + } + }, + views: [ + { + id: 'custom-view' + } + ], + force: resetLayout + } +} +export const commonServices: IEditorOverrideServices = { + ..._commonService, + ...getOutlineServiceOverride(), // session REMOVED + ...getSnippetServiceOverride(), + ...getSearchServiceOverride(), + ...getChatServiceOverride({ + defaultAccount: { + entitlementsData: { + access_type_sku: 'unused', + assigned_date: 'unused', + can_signup_for_limited: false, + copilot_plan: 'enterprise', + organization_login_list: [], + analytics_tracking_id: 'unused', + chat_enabled: true + }, + accountName: 'unused', + authenticationProvider: { + id: 'unused', + name: 'unused', + enterprise: true + }, + enterprise: true, + sessionId: 'unused' + } + }), + ...getUserDataSyncServiceOverride(), + ...getWalkThroughServiceOverride(), + ...getWelcomeServiceOverride(), + ...getTelemetryServiceOverride(), + ...getMcpServiceOverride(), + ...getMeteredConnectionServiceOverride(), + + ...getTimelineServiceOverride(), + ...getDialogsServiceOverride(), + ...getTestingServiceOverride(), + ...getDebugServiceOverride(), + ...getExtensionGalleryServiceOverride({ webOnly: false }), + + ...getConfigurationServiceOverride(), + ...getMarkersServiceOverride(), + ...getGithubServiceOverride(), + ...getTitleBarServiceOverride() +} diff --git a/demo/src/setup.common.session.ts b/demo/src/setup.common.session.ts new file mode 100644 index 00000000..d44da524 --- /dev/null +++ b/demo/src/setup.common.session.ts @@ -0,0 +1,93 @@ +export * from './setup.common' +import { constructOptions as commonConstructOptions } from './setup.common' + +import { + IEditorOverrideServices, + IWorkbenchConstructionOptions +} from '@codingame/monaco-vscode-api' +import * as vscode from 'vscode' +import { commonServices as _commonService } from './setup.common' +import getOutlineServiceOverride from '@codingame/monaco-vscode-outline-service-override/session' +import getSearchServiceOverride from '@codingame/monaco-vscode-search-service-override/session' +import getChatServiceOverride from '@codingame/monaco-vscode-chat-service-override/session' +import getWelcomeServiceOverride from '@codingame/monaco-vscode-welcome-service-override/session' +import getUserDataSyncServiceOverride from '@codingame/monaco-vscode-user-data-sync-service-override/session' +import getTelemetryServiceOverride from '@codingame/monaco-vscode-telemetry-service-override/session' +import getMcpServiceOverride from '@codingame/monaco-vscode-mcp-service-override/session' +import getConfigurationServiceOverride from '@codingame/monaco-vscode-configuration-service-override/session' +import getDialogsServiceOverride from '@codingame/monaco-vscode-dialogs-service-override/session' +import getExtensionGalleryServiceOverride from '@codingame/monaco-vscode-extension-gallery-service-override/session' +import getDebugServiceOverride from '@codingame/monaco-vscode-debug-service-override/session' +import getMarkersServiceOverride from '@codingame/monaco-vscode-markers-service-override/session' +import getTestingServiceOverride from '@codingame/monaco-vscode-testing-service-override/session' +import getTimelineServiceOverride from '@codingame/monaco-vscode-timeline-service-override/session' +import getGithubServiceOverride from '@codingame/monaco-vscode-github-service-override/session' +import getTitleBarServiceOverride from '@codingame/monaco-vscode-view-title-bar-service-override/session' + +export const constructOptions: IWorkbenchConstructionOptions = { + ...commonConstructOptions, + configurationDefaults: { + ...commonConstructOptions.configurationDefaults, + 'chat.remoteAgentHosts': [ + { + address: '127.0.0.1:9187', + name: 'ahpd' + } + ], + 'sessions.useWorktree': false + }, + workspaceProvider: { + trusted: true, + async open() { + window.open(window.location.href) + return true + }, + workspace: { + id: 'session-workspace', + workspaceUri: vscode.Uri.from({ + path: '/User/agent-sessions.code-workspace', + scheme: 'vscode-userdata' + }) + } + } +} + +export const commonServices: IEditorOverrideServices = { + ..._commonService, + ...getOutlineServiceOverride(), + ...getSearchServiceOverride(), + ...getChatServiceOverride({ + defaultAccount: { + entitlementsData: { + access_type_sku: 'unused', + assigned_date: 'unused', + can_signup_for_limited: false, + copilot_plan: 'enterprise', + organization_login_list: [], + analytics_tracking_id: 'unused', + chat_enabled: true + }, + accountName: 'CodinGame', + authenticationProvider: { + id: 'unused', + name: 'unused', + enterprise: true + }, + enterprise: true, + sessionId: 'unused' + } + }), + ...getUserDataSyncServiceOverride(), + ...getWelcomeServiceOverride(), + ...getTelemetryServiceOverride(), + ...getMcpServiceOverride(), + ...getTimelineServiceOverride(), + ...getDialogsServiceOverride(), + ...getTestingServiceOverride(), + ...getDebugServiceOverride(), + ...getExtensionGalleryServiceOverride({ webOnly: false }), + ...getConfigurationServiceOverride(), + ...getMarkersServiceOverride(), + ...getGithubServiceOverride(), + ...getTitleBarServiceOverride() +} diff --git a/demo/src/setup.common.ts b/demo/src/setup.common.ts index dcb9bdfe..e41362e9 100644 --- a/demo/src/setup.common.ts +++ b/demo/src/setup.common.ts @@ -1,292 +1,78 @@ -import getConfigurationServiceOverride, { - IStoredWorkspace, - initUserConfiguration -} from '@codingame/monaco-vscode-configuration-service-override' -import getKeybindingsServiceOverride, { - initUserKeybindings -} from '@codingame/monaco-vscode-keybindings-service-override' import { - RegisteredFileSystemProvider, - RegisteredMemoryFile, - RegisteredReadOnlyFile, - createIndexedDBProviders, - registerHTMLFileSystemProvider, - createHTMLFileSystemProvider, - registerFileSystemOverlay, - initFile -} from '@codingame/monaco-vscode-files-service-override' -import * as monaco from 'monaco-editor' -import { - IWorkbenchConstructionOptions, - LogLevel, IEditorOverrideServices, - IWorkspace + IWorkbenchConstructionOptions, + LogLevel } from '@codingame/monaco-vscode-api' -import * as vscode from 'vscode' +import { initUserConfiguration } from '@codingame/monaco-vscode-configuration-service-override/common' +import { createIndexedDBProviders } from '@codingame/monaco-vscode-files-service-override' +import getKeybindingsServiceOverride, { + initUserKeybindings +} from '@codingame/monaco-vscode-keybindings-service-override' import getModelServiceOverride from '@codingame/monaco-vscode-model-service-override' import getNotificationServiceOverride from '@codingame/monaco-vscode-notifications-service-override' -import getDialogsServiceOverride from '@codingame/monaco-vscode-dialogs-service-override' -import getTextmateServiceOverride from '@codingame/monaco-vscode-textmate-service-override' -import getThemeServiceOverride from '@codingame/monaco-vscode-theme-service-override' -import getLanguagesServiceOverride from '@codingame/monaco-vscode-languages-service-override' -import getSecretStorageServiceOverride from '@codingame/monaco-vscode-secret-storage-service-override' -import getAuthenticationServiceOverride from '@codingame/monaco-vscode-authentication-service-override' -import getScmServiceOverride from '@codingame/monaco-vscode-scm-service-override' -import getExtensionGalleryServiceOverride from '@codingame/monaco-vscode-extension-gallery-service-override' -import getBannerServiceOverride from '@codingame/monaco-vscode-view-banner-service-override' -import getStatusBarServiceOverride from '@codingame/monaco-vscode-view-status-bar-service-override' -import getTitleBarServiceOverride from '@codingame/monaco-vscode-view-title-bar-service-override' -import getDebugServiceOverride from '@codingame/monaco-vscode-debug-service-override' -import getPreferencesServiceOverride from '@codingame/monaco-vscode-preferences-service-override' -import getSnippetServiceOverride from '@codingame/monaco-vscode-snippets-service-override' -import getOutputServiceOverride from '@codingame/monaco-vscode-output-service-override' -import getTerminalServiceOverride from '@codingame/monaco-vscode-terminal-service-override' -import getSearchServiceOverride from '@codingame/monaco-vscode-search-service-override' -import getMarkersServiceOverride from '@codingame/monaco-vscode-markers-service-override' +import * as vscode from 'vscode' + import getAccessibilityServiceOverride from '@codingame/monaco-vscode-accessibility-service-override' -import getLanguageDetectionWorkerServiceOverride from '@codingame/monaco-vscode-language-detection-worker-service-override' -import getStorageServiceOverride from '@codingame/monaco-vscode-storage-service-override' -import getExtensionServiceOverride from '@codingame/monaco-vscode-extensions-service-override' -import getRemoteAgentServiceOverride from '@codingame/monaco-vscode-remote-agent-service-override' -import getEnvironmentServiceOverride from '@codingame/monaco-vscode-environment-service-override' -import getLifecycleServiceOverride from '@codingame/monaco-vscode-lifecycle-service-override' -import getWorkspaceTrustOverride from '@codingame/monaco-vscode-workspace-trust-service-override' -import getLogServiceOverride from '@codingame/monaco-vscode-log-service-override' -import getWorkingCopyServiceOverride from '@codingame/monaco-vscode-working-copy-service-override' -import getTestingServiceOverride from '@codingame/monaco-vscode-testing-service-override' -import getChatServiceOverride, { - ChatEntitlement -} from '@codingame/monaco-vscode-chat-service-override' -import getNotebookServiceOverride from '@codingame/monaco-vscode-notebook-service-override' -import getWelcomeServiceOverride from '@codingame/monaco-vscode-welcome-service-override' -import getWalkThroughServiceOverride from '@codingame/monaco-vscode-walkthrough-service-override' -import getUserDataSyncServiceOverride from '@codingame/monaco-vscode-user-data-sync-service-override' -import getUserDataProfileServiceOverride from '@codingame/monaco-vscode-user-data-profile-service-override' import getAiServiceOverride from '@codingame/monaco-vscode-ai-service-override' -import getTaskServiceOverride from '@codingame/monaco-vscode-task-service-override' -import getOutlineServiceOverride from '@codingame/monaco-vscode-outline-service-override' -import getTimelineServiceOverride from '@codingame/monaco-vscode-timeline-service-override' +import { EnvironmentOverride } from '@codingame/monaco-vscode-api/workbench' +import getAssignmentServiceOverride from '@codingame/monaco-vscode-assignment-service-override' +import getAuthenticationServiceOverride from '@codingame/monaco-vscode-authentication-service-override' +import { ChatEntitlement } from '@codingame/monaco-vscode-chat-service-override/common' import getCommentsServiceOverride from '@codingame/monaco-vscode-comments-service-override' import getEditSessionsServiceOverride from '@codingame/monaco-vscode-edit-sessions-service-override' import getEmmetServiceOverride from '@codingame/monaco-vscode-emmet-service-override' +import getEnvironmentServiceOverride from '@codingame/monaco-vscode-environment-service-override' +import getExplorerServiceOverride from '@codingame/monaco-vscode-explorer-service-override' +import getExtensionServiceOverride from '@codingame/monaco-vscode-extensions-service-override' +import getImageResizeServiceOverride from '@codingame/monaco-vscode-image-resize-service-override' import getInteractiveServiceOverride from '@codingame/monaco-vscode-interactive-service-override' import getIssueServiceOverride from '@codingame/monaco-vscode-issue-service-override' +import getLanguageDetectionWorkerServiceOverride from '@codingame/monaco-vscode-language-detection-worker-service-override' +import getLanguagesServiceOverride from '@codingame/monaco-vscode-languages-service-override' +import getLifecycleServiceOverride from '@codingame/monaco-vscode-lifecycle-service-override' +import getLocalizationServiceOverride from '@codingame/monaco-vscode-localization-service-override' +import getLogServiceOverride from '@codingame/monaco-vscode-log-service-override' import getMultiDiffEditorServiceOverride from '@codingame/monaco-vscode-multi-diff-editor-service-override' +import getNotebookServiceOverride from '@codingame/monaco-vscode-notebook-service-override' +import getOutputServiceOverride from '@codingame/monaco-vscode-output-service-override' import getPerformanceServiceOverride from '@codingame/monaco-vscode-performance-service-override' +import getPreferencesServiceOverride from '@codingame/monaco-vscode-preferences-service-override' +import getProcessControllerServiceOverride from '@codingame/monaco-vscode-process-explorer-service-override' import getRelauncherServiceOverride from '@codingame/monaco-vscode-relauncher-service-override' +import getRemoteAgentServiceOverride from '@codingame/monaco-vscode-remote-agent-service-override' +import getScmServiceOverride from '@codingame/monaco-vscode-scm-service-override' +import getSecretStorageServiceOverride from '@codingame/monaco-vscode-secret-storage-service-override' import getShareServiceOverride from '@codingame/monaco-vscode-share-service-override' import getSpeechServiceOverride from '@codingame/monaco-vscode-speech-service-override' +import getStorageServiceOverride from '@codingame/monaco-vscode-storage-service-override' import getSurveyServiceOverride from '@codingame/monaco-vscode-survey-service-override' -import getUpdateServiceOverride from '@codingame/monaco-vscode-update-service-override' -import getExplorerServiceOverride from '@codingame/monaco-vscode-explorer-service-override' -import getLocalizationServiceOverride from '@codingame/monaco-vscode-localization-service-override' +import getTaskServiceOverride from '@codingame/monaco-vscode-task-service-override' +import getTerminalServiceOverride from '@codingame/monaco-vscode-terminal-service-override' +import getTextmateServiceOverride from '@codingame/monaco-vscode-textmate-service-override' +import getThemeServiceOverride from '@codingame/monaco-vscode-theme-service-override' import getTreeSitterServiceOverride from '@codingame/monaco-vscode-treesitter-service-override' -import getTelemetryServiceOverride from '@codingame/monaco-vscode-telemetry-service-override' -import getMcpServiceOverride from '@codingame/monaco-vscode-mcp-service-override' -import getProcessControllerServiceOverride from '@codingame/monaco-vscode-process-explorer-service-override' -import getImageResizeServiceOverride from '@codingame/monaco-vscode-image-resize-service-override' -import getAssignmentServiceOverride from '@codingame/monaco-vscode-assignment-service-override' -import getGithubServiceOverride from '@codingame/monaco-vscode-github-service-override' -import getMeteredConnectionServiceOverride from '@codingame/monaco-vscode-metered-connection-service-override' -import { EnvironmentOverride } from '@codingame/monaco-vscode-api/workbench' +import getUpdateServiceOverride from '@codingame/monaco-vscode-update-service-override' +import getUserDataProfileServiceOverride from '@codingame/monaco-vscode-user-data-profile-service-override' +import getBannerServiceOverride from '@codingame/monaco-vscode-view-banner-service-override' +import getStatusBarServiceOverride from '@codingame/monaco-vscode-view-status-bar-service-override' +import getWorkingCopyServiceOverride from '@codingame/monaco-vscode-working-copy-service-override' +import getWorkspaceTrustOverride from '@codingame/monaco-vscode-workspace-trust-service-override' +import 'vscode/localExtensionHost' +import { TerminalBackend } from './features/terminal.js' import { Worker } from './tools/fakeWorker.js' -import defaultKeybindings from './user/keybindings.json?raw' import defaultConfiguration from './user/configuration.json?raw' -import { TerminalBackend } from './features/terminal.js' -import 'vscode/localExtensionHost' +import defaultKeybindings from './user/keybindings.json?raw' const url = new URL(document.location.href) -const params = url.searchParams +export const params = url.searchParams export const remoteAuthority = params.get('remoteAuthority') ?? undefined export const connectionToken = params.get('connectionToken') ?? undefined -export const remotePath = - remoteAuthority != null ? (params.get('remotePath') ?? undefined) : undefined -export const resetLayout = params.has('resetLayout') -export const useHtmlFileSystemProvider = params.has('htmlFileSystemProvider') export const disableShadowDom = params.has('disableShadowDom') -params.delete('resetLayout') window.history.replaceState({}, document.title, url.href) -let workspace: IWorkspace = { - workspaceUri: monaco.Uri.file('/workspace.code-workspace') -} - export const userDataProvider = await createIndexedDBProviders() -if (useHtmlFileSystemProvider) { - const workspaceFile = monaco.Uri.from({ scheme: 'tmp', path: '/test.code-workspace' }) - await initFile( - workspaceFile, - JSON.stringify( - { - folders: [] - }, - null, - 2 - ) - ) - workspace = { - workspaceUri: workspaceFile - } - registerHTMLFileSystemProvider() -} else { - const fileSystemProvider = new RegisteredFileSystemProvider(false) - - fileSystemProvider.registerFile( - new RegisteredMemoryFile( - vscode.Uri.file('/workspace/test.js'), - `// import anotherfile -let variable = 1 -function inc () { - variable++ -} - -while (variable < 5000) { - inc() - console.log('Hello world', variable); -}` - ) - ) - - const content = new TextEncoder().encode('This is a readonly static file') - fileSystemProvider.registerFile( - new RegisteredReadOnlyFile( - vscode.Uri.file('/workspace/test_readonly.js'), - async () => content, - content.length - ) - ) - - fileSystemProvider.registerFile( - new RegisteredMemoryFile( - vscode.Uri.file('/workspace/jsconfig.json'), - `{ - "compilerOptions": { - "target": "es2020", - "module": "esnext", - "lib": [ - "es2021", - "DOM" - ] - } -}` - ) - ) - - fileSystemProvider.registerFile( - new RegisteredMemoryFile( - vscode.Uri.file('/workspace/index.html'), - ` - - - - - monaco-vscode-api demo - - - - - -

Hello, world!

- -` - ) - ) - - fileSystemProvider.registerFile( - new RegisteredMemoryFile( - vscode.Uri.file('/workspace/test.md'), - ` -***Hello World*** - -Math block: -$$ -\\displaystyle -\\left( \\sum_{k=1}^n a_k b_k \\right)^2 -\\leq -\\left( \\sum_{k=1}^n a_k^2 \\right) -\\left( \\sum_{k=1}^n b_k^2 \\right) -$$ - -# Easy Math - -2 + 2 = 4 // this test will pass -2 + 2 = 5 // this test will fail - -# Harder Math - -230230 + 5819123 = 6049353 -` - ) - ) - - fileSystemProvider.registerFile( - new RegisteredMemoryFile( - vscode.Uri.file('/workspace/test.customeditor'), - ` -Custom Editor!` - ) - ) - - fileSystemProvider.registerFile( - new RegisteredMemoryFile( - vscode.Uri.file('/workspace/test.css'), - ` -h1 { - color: DeepSkyBlue; -}` - ) - ) - - const workspaceFile = monaco.Uri.file('/workspace.code-workspace') - // Use a workspace file to be able to add another folder later (for the "Attach filesystem" button) - fileSystemProvider.registerFile( - new RegisteredMemoryFile( - workspaceFile, - JSON.stringify( - { - folders: [ - { - path: '/workspace' - } - ] - }, - null, - 2 - ) - ) - ) - workspace = { - workspaceUri: workspaceFile - } - - fileSystemProvider.registerFile( - new RegisteredMemoryFile( - monaco.Uri.file('/workspace/.vscode/extensions.json'), - JSON.stringify( - { - recommendations: ['vscodevim.vim'] - }, - null, - 2 - ) - ) - ) - - registerFileSystemOverlay(1, fileSystemProvider) - - const htmlFileProvider = createHTMLFileSystemProvider() - htmlFileProvider.registerDirectoryHandle( - await (await navigator.storage.getDirectory()).getDirectoryHandle('workspace', { create: true }) - ) - registerFileSystemOverlay(2, htmlFileProvider) -} - // Workers const workers: Partial> = { editorWorkerService: new Worker( @@ -346,57 +132,12 @@ export const constructOptions: IWorkbenchConstructionOptions = { tooltip: '', command: '' }, - workspaceProvider: { - trusted: true, - async open() { - window.open(window.location.href) - return true - }, - workspace: - remotePath == null - ? workspace - : { - folderUri: monaco.Uri.from({ - scheme: 'vscode-remote', - path: remotePath, - authority: remoteAuthority - }) - } - }, developmentOptions: { logLevel: LogLevel.Info // Default value }, configurationDefaults: { 'window.title': 'Monaco-Vscode-Api${separator}${dirty}${activeEditorShort}' }, - defaultLayout: { - editors: useHtmlFileSystemProvider - ? undefined - : [ - { - uri: monaco.Uri.file('/workspace/test.js'), - viewColumn: 1 - }, - { - uri: monaco.Uri.file('/workspace/test.md'), - viewColumn: 2 - } - ], - layout: useHtmlFileSystemProvider - ? undefined - : { - editors: { - orientation: 0, - groups: [{ size: 1 }, { size: 1 }] - } - }, - views: [ - { - id: 'custom-view' - } - ], - force: resetLayout - }, welcomeBanner: { message: 'Welcome in monaco-vscode-api demo' }, @@ -437,33 +178,28 @@ export const commonServices: IEditorOverrideServices = { enableWorkerExtensionHost: true, iframeAlternateDomain: alternateDomainPattern }), - ...getExtensionGalleryServiceOverride({ webOnly: false }), + ...getModelServiceOverride(), ...getNotificationServiceOverride(), - ...getDialogsServiceOverride(), - ...getConfigurationServiceOverride(), + ...getKeybindingsServiceOverride(), ...getTextmateServiceOverride(), ...getTreeSitterServiceOverride(), ...getThemeServiceOverride(), ...getLanguagesServiceOverride(), - ...getDebugServiceOverride(), + ...getPreferencesServiceOverride(), - ...getOutlineServiceOverride(), - ...getTimelineServiceOverride(), + ...getBannerServiceOverride(), ...getStatusBarServiceOverride(), - ...getTitleBarServiceOverride(), - ...getSnippetServiceOverride(), + ...getOutputServiceOverride(), ...getTerminalServiceOverride(new TerminalBackend()), - ...getSearchServiceOverride(), - ...getMarkersServiceOverride(), + ...getAccessibilityServiceOverride(), ...getLanguageDetectionWorkerServiceOverride(), ...getStorageServiceOverride({ - fallbackOverride: { - 'workbench.activity.showAccounts': false, + forcedValues: { /** * VSCode stores in its storage the chat setup state * We need it to be configured out of the box, with is not supported by VSCode @@ -478,6 +214,9 @@ export const commonServices: IEditorOverrideServices = { completed: true, installed: true } + }, + fallbackOverride: { + 'workbench.activity.showAccounts': false } }), ...getRemoteAgentServiceOverride({ scanRemoteExtensions: true }), @@ -486,33 +225,11 @@ export const commonServices: IEditorOverrideServices = { ...getWorkspaceTrustOverride(), ...getWorkingCopyServiceOverride(), ...getScmServiceOverride(), - ...getTestingServiceOverride(), - ...getChatServiceOverride({ - defaultAccount: { - entitlementsData: { - access_type_sku: 'unused', - assigned_date: 'unused', - can_signup_for_limited: false, - copilot_plan: 'enterprise', - organization_login_list: [], - analytics_tracking_id: 'unused', - chat_enabled: true - }, - accountName: 'unused', - authenticationProvider: { - id: 'unused', - name: 'unused', - enterprise: true - }, - enterprise: true, - sessionId: 'unused' - } - }), + ...getNotebookServiceOverride(), - ...getWelcomeServiceOverride(), - ...getWalkThroughServiceOverride(), + ...getUserDataProfileServiceOverride(), - ...getUserDataSyncServiceOverride(), + ...getAiServiceOverride(), ...getTaskServiceOverride(), ...getCommentsServiceOverride(), @@ -607,11 +324,8 @@ export const commonServices: IEditorOverrideServices = { ] }), ...getSecretStorageServiceOverride(), - ...getTelemetryServiceOverride(), - ...getMcpServiceOverride(), + ...getProcessControllerServiceOverride(), ...getImageResizeServiceOverride(), - ...getAssignmentServiceOverride(), - ...getGithubServiceOverride(), - ...getMeteredConnectionServiceOverride() + ...getAssignmentServiceOverride() } diff --git a/demo/src/setup.views.ts b/demo/src/setup.views.ts index eb026a4f..502552ab 100644 --- a/demo/src/setup.views.ts +++ b/demo/src/setup.views.ts @@ -28,7 +28,7 @@ import { envOptions, remoteAuthority, userDataProvider -} from './setup.common' +} from './setup.common.classic' const container = document.createElement('div') container.id = 'app' diff --git a/demo/src/setup.workbench.ts b/demo/src/setup.workbench.classic.ts similarity index 99% rename from demo/src/setup.workbench.ts rename to demo/src/setup.workbench.classic.ts index 6991780d..6dd71832 100644 --- a/demo/src/setup.workbench.ts +++ b/demo/src/setup.workbench.classic.ts @@ -20,7 +20,7 @@ import { userDataProvider, disableShadowDom, alternateDomainPattern -} from './setup.common' +} from './setup.common.classic' let container = window.vscodeContainer diff --git a/demo/src/setup.workbench.session.ts b/demo/src/setup.workbench.session.ts new file mode 100644 index 00000000..0fdda873 --- /dev/null +++ b/demo/src/setup.workbench.session.ts @@ -0,0 +1,93 @@ +import { + IStorageService, + getService, + initialize as initializeMonacoService +} from '@codingame/monaco-vscode-api' +import { registerExtension } from '@codingame/monaco-vscode-api/extensions' +import { ExtensionHostKind } from '@codingame/monaco-vscode-extensions-service-override' +import getQuickAccessServiceOverride from '@codingame/monaco-vscode-quickaccess-service-override' +import { BrowserStorageService } from '@codingame/monaco-vscode-storage-service-override' +import getWorkbenchServiceOverride from '@codingame/monaco-vscode-workbench-service-override/session' +import './features/customView.workbench' +import { + alternateDomainPattern, + commonServices, + constructOptions, + disableShadowDom, + envOptions, + remoteAuthority, + userDataProvider +} from './setup.common.session' + +let container = window.vscodeContainer + +if (container == null) { + container = document.createElement('div') + container.style.height = '100vh' + + document.body.replaceChildren(container) + + if (!disableShadowDom) { + const shadowRoot = container.attachShadow({ + mode: 'open' + }) + + const workbenchElement = document.createElement('div') + workbenchElement.style.height = '100vh' + shadowRoot.appendChild(workbenchElement) + container = workbenchElement + } +} + +const buttons = document.createElement('div') +buttons.innerHTML = ` + + + + + +
+ +` +document.body.append(buttons) + +// Override services +await initializeMonacoService( + { + ...commonServices, + ...getWorkbenchServiceOverride(undefined, alternateDomainPattern), + ...getQuickAccessServiceOverride({ + isKeybindingConfigurationVisible: () => true, + shouldUseGlobalPicker: () => true + }) + }, + container, + constructOptions, + envOptions +) + +document.querySelector('#toggleSandbox')!.addEventListener('click', async () => { + const url = new URL(window.location.href) + url.search = '' + url.searchParams.append('sandbox', '') + window.location.href = url.toString() +}) + +export async function clearStorage(): Promise { + await userDataProvider.reset() + await ((await getService(IStorageService)) as BrowserStorageService).clear() +} + +await registerExtension( + { + name: 'demo', + publisher: 'codingame', + version: '1.0.0', + engines: { + vscode: '*' + } + }, + ExtensionHostKind.LocalProcess +).setAsDefaultApi() + +export { remoteAuthority } From a78d1e48856bf1c94f39e75530b117caadc4ad7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 28 Sep 2026 18:41:55 +0200 Subject: [PATCH 28/35] fix(demo): use dynamic imports to guarantee execution order --- demo/src/main.views.ts | 2 +- demo/src/main.workbench.classic.ts | 2 +- demo/src/main.workbench.session.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/demo/src/main.views.ts b/demo/src/main.views.ts index 5a6dc0f7..9d89c594 100644 --- a/demo/src/main.views.ts +++ b/demo/src/main.views.ts @@ -19,7 +19,7 @@ import { clearStorage } from './setup.views' import { CustomEditorInput } from './features/customView.views' import defaultConfiguration from './user/configuration.json?raw' import defaultKeybindings from './user/keybindings.json?raw' -import './main.common' +void import('./main.common') document.querySelector('#customEditorPanel')!.addEventListener('click', async () => { const input = await createInstance(CustomEditorInput, undefined) diff --git a/demo/src/main.workbench.classic.ts b/demo/src/main.workbench.classic.ts index e1641ce3..dc84f9fc 100644 --- a/demo/src/main.workbench.classic.ts +++ b/demo/src/main.workbench.classic.ts @@ -1,7 +1,7 @@ import { IEditorService, StandaloneServices, createInstance } from '@codingame/monaco-vscode-api' import { clearStorage } from './setup.workbench.classic' import { CustomEditorInput } from './features/customView.workbench' -import './main.common' +void import('./main.common') document.querySelector('#customEditorPanel')!.addEventListener('click', async () => { const input = await createInstance(CustomEditorInput, undefined) diff --git a/demo/src/main.workbench.session.ts b/demo/src/main.workbench.session.ts index 9284fcb2..fef4b321 100644 --- a/demo/src/main.workbench.session.ts +++ b/demo/src/main.workbench.session.ts @@ -1,5 +1,5 @@ import { clearStorage } from './setup.workbench.session' -import './main.common' +void import('./main.common') document.querySelector('#clearStorage')!.addEventListener('click', async () => { await clearStorage() From 0b2e34d062d8b6aedc103c5e18f5ca90265a5462 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Tue, 29 Sep 2026 10:12:33 +0200 Subject: [PATCH 29/35] fix: regenerate patches --- ...ntime-dependencies-from-core-on-cha.patch} | 37 +++++++++---------- ...tension-host-contribution-per-featu.patch} | 13 +++---- 2 files changed, 22 insertions(+), 28 deletions(-) rename vscode-patches/{0109-refactor-avoid-runtime-dependencies-from-core-on-cha.patch => 0108-refactor-avoid-runtime-dependencies-from-core-on-cha.patch} (97%) rename vscode-patches/{0110-refactor-split-extension-host-contribution-per-featu.patch => 0109-refactor-split-extension-host-contribution-per-featu.patch} (98%) diff --git a/vscode-patches/0109-refactor-avoid-runtime-dependencies-from-core-on-cha.patch b/vscode-patches/0108-refactor-avoid-runtime-dependencies-from-core-on-cha.patch similarity index 97% rename from vscode-patches/0109-refactor-avoid-runtime-dependencies-from-core-on-cha.patch rename to vscode-patches/0108-refactor-avoid-runtime-dependencies-from-core-on-cha.patch index 6e061657..778fc5c3 100644 --- a/vscode-patches/0109-refactor-avoid-runtime-dependencies-from-core-on-cha.patch +++ b/vscode-patches/0108-refactor-avoid-runtime-dependencies-from-core-on-cha.patch @@ -34,7 +34,7 @@ Co-Authored-By: Claude Opus 5.5 create mode 100644 src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.ts diff --git a/src/vs/workbench/api/common/extHostLanguageModelTools.ts b/src/vs/workbench/api/common/extHostLanguageModelTools.ts -index f34d76c9..782d83e6 100644 +index f34d76c9e8d..782d83e6c17 100644 --- a/src/vs/workbench/api/common/extHostLanguageModelTools.ts +++ b/src/vs/workbench/api/common/extHostLanguageModelTools.ts @@ -13,8 +13,7 @@ import { generateUuid } from '../../../base/common/uuid.js'; @@ -48,7 +48,7 @@ index f34d76c9..782d83e6 100644 import { checkProposedApiEnabled, isProposedApiEnabled } from '../../services/extensions/common/extensions.js'; import { Dto, SerializableObjectWithBuffers } from '../../services/extensions/common/proxyIdentifier.js'; diff --git a/src/vs/workbench/api/common/extHostTypeConverters.ts b/src/vs/workbench/api/common/extHostTypeConverters.ts -index b3e6860b..36aa3bf9 100644 +index b3e6860bac0..36aa3bf91db 100644 --- a/src/vs/workbench/api/common/extHostTypeConverters.ts +++ b/src/vs/workbench/api/common/extHostTypeConverters.ts @@ -46,7 +46,7 @@ import { IChatRequestModeInstructions } from '../../contrib/chat/common/model/ch @@ -61,7 +61,7 @@ index b3e6860b..36aa3bf9 100644 import { ChatAgentLocation } from '../../contrib/chat/common/constants.js'; import { ChatRequestHooks, resolveEffectiveCommand } from '../../contrib/chat/common/promptSyntax/hookSchema.js'; diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatConstants.ts b/src/vs/workbench/contrib/chat/browser/actions/chatConstants.ts -index 17e137b5..71002004 100644 +index 17e137b5eb0..71002004183 100644 --- a/src/vs/workbench/contrib/chat/browser/actions/chatConstants.ts +++ b/src/vs/workbench/contrib/chat/browser/actions/chatConstants.ts @@ -6,6 +6,7 @@ import { localize2 } from '../../../../../nls.js'; @@ -74,7 +74,7 @@ index 17e137b5..71002004 100644 export const SkipToolConfirmationActionId = 'workbench.action.chat.skipTool'; diff --git a/src/vs/workbench/contrib/chat/common/chatImageBuffer.ts b/src/vs/workbench/contrib/chat/common/chatImageBuffer.ts new file mode 100644 -index 00000000..4d0b845d +index 00000000000..4d0b845d10d --- /dev/null +++ b/src/vs/workbench/contrib/chat/common/chatImageBuffer.ts @@ -0,0 +1,34 @@ @@ -113,7 +113,7 @@ index 00000000..4d0b845d + return result; +} diff --git a/src/vs/workbench/contrib/chat/common/chatImageExtraction.ts b/src/vs/workbench/contrib/chat/common/chatImageExtraction.ts -index cc289ef3..d0ae0f2d 100644 +index cc289ef3688..d0ae0f2d3b9 100644 --- a/src/vs/workbench/contrib/chat/common/chatImageExtraction.ts +++ b/src/vs/workbench/contrib/chat/common/chatImageExtraction.ts @@ -14,6 +14,9 @@ import { ChatResponseResource } from './model/chatModel.js'; @@ -162,7 +162,7 @@ index cc289ef3..d0ae0f2d 100644 * Extract images from a chat request's variable attachments (user-attached images). */ diff --git a/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.ts b/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.ts -index addfc96f..fc33b652 100644 +index addfc96f5d6..fc33b652e51 100644 --- a/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.ts +++ b/src/vs/workbench/contrib/chat/common/tools/builtinTools/editFileTool.ts @@ -15,9 +15,10 @@ import { ICodeMapperService } from '../../editing/chatCodeMapperService.js'; @@ -180,7 +180,7 @@ index addfc96f..fc33b652 100644 displayName: '', // not used diff --git a/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.ts b/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.ts new file mode 100644 -index 00000000..91daae1f +index 00000000000..91daae1fb40 --- /dev/null +++ b/src/vs/workbench/contrib/chat/common/tools/builtinTools/toolIds.ts @@ -0,0 +1,9 @@ @@ -194,7 +194,7 @@ index 00000000..91daae1f +export const InternalEditToolId = 'vscode_editFile_internal'; +export const InternalFetchWebPageToolId = 'vscode_fetchWebPage_internal'; diff --git a/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.ts b/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.ts -index 4a711c40..bec1c893 100644 +index 4a711c404fa..bec1c893d6e 100644 --- a/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.ts +++ b/src/vs/workbench/contrib/chat/common/tools/builtinTools/tools.ts @@ -104,4 +104,4 @@ export class BuiltinToolsContribution extends Disposable implements IWorkbenchCo @@ -204,7 +204,7 @@ index 4a711c40..bec1c893 100644 -export const InternalFetchWebPageToolId = 'vscode_fetchWebPage_internal'; +export { InternalFetchWebPageToolId } from './toolIds.js'; diff --git a/src/vs/workbench/contrib/scm/browser/scm.contribution.ts b/src/vs/workbench/contrib/scm/browser/scm.contribution.ts -index 6ee2a32c..a5cba418 100644 +index 6ee2a32c3a8..a5cba418abd 100644 --- a/src/vs/workbench/contrib/scm/browser/scm.contribution.ts +++ b/src/vs/workbench/contrib/scm/browser/scm.contribution.ts @@ -40,7 +40,7 @@ import { SCMAccessibilityHelp } from './scmAccessibilityHelp.js'; @@ -217,7 +217,7 @@ index 6ee2a32c..a5cba418 100644 import product from '../../../../platform/product/common/product.js'; diff --git a/src/vs/workbench/contrib/scm/browser/scmInput.ts b/src/vs/workbench/contrib/scm/browser/scmInput.ts -index 63642985..66846d74 100644 +index 63642985fc7..66846d740c1 100644 --- a/src/vs/workbench/contrib/scm/browser/scmInput.ts +++ b/src/vs/workbench/contrib/scm/browser/scmInput.ts @@ -70,7 +70,7 @@ import { IAccessibilityService } from '../../../../platform/accessibility/common @@ -230,7 +230,7 @@ index 63642985..66846d74 100644 export const SCMInputContextKeys = { SCMInputHasValidationMessage: new RawContextKey('scmInputHasValidationMessage', false), diff --git a/src/vs/workbench/contrib/search/browser/searchTreeModel/searchResult.ts b/src/vs/workbench/contrib/search/browser/searchTreeModel/searchResult.ts -index c55c9aa6..7cba78cd 100644 +index c55c9aa68da..7cba78cd0ef 100644 --- a/src/vs/workbench/contrib/search/browser/searchTreeModel/searchResult.ts +++ b/src/vs/workbench/contrib/search/browser/searchTreeModel/searchResult.ts @@ -10,7 +10,7 @@ import { ITextModel } from '../../../../../editor/common/model.js'; @@ -256,7 +256,7 @@ index c55c9aa6..7cba78cd 100644 this._id = SEARCH_RESULT_PREFIX + Date.now().toString(); diff --git a/src/vs/workbench/contrib/search/browser/searchView.ts b/src/vs/workbench/contrib/search/browser/searchView.ts -index cd44270e..9f200dd3 100644 +index cd44270eb87..9f200dd318f 100644 --- a/src/vs/workbench/contrib/search/browser/searchView.ts +++ b/src/vs/workbench/contrib/search/browser/searchView.ts @@ -55,7 +55,8 @@ import { IViewPaneOptions, ViewPane } from '../../../browser/parts/views/viewPan @@ -288,7 +288,7 @@ index cd44270e..9f200dd3 100644 // Ensure that the editor widget is binded. If if is, then this should return immediately. // Otherwise, it will bind the widget. diff --git a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts -index 129e228a..6c4ba470 100644 +index 129e228a126..6c4ba470084 100644 --- a/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts +++ b/src/vs/workbench/contrib/tasks/browser/abstractTaskService.ts @@ -85,7 +85,7 @@ import { IPathService } from '../../../services/path/common/pathService.js'; @@ -301,7 +301,7 @@ index 129e228a..6c4ba470 100644 import { IChatService } from '../../chat/common/chatService/chatService.js'; import { configureTaskIcon, isWorkspaceFolder, ITaskQuickPickEntry, QUICKOPEN_DETAIL_CONFIG, QUICKOPEN_SKIP_CONFIG, TaskQuickPick } from './taskQuickPick.js'; diff --git a/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts b/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts -index 0294c9fa..a7edf1ca 100644 +index 0294c9fae45..a7edf1caadc 100644 --- a/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts +++ b/src/vs/workbench/contrib/terminal/browser/xterm/decorationAddon.ts @@ -29,7 +29,7 @@ import { MarkdownString } from '../../../../../base/common/htmlContent.js'; @@ -323,7 +323,7 @@ index 0294c9fa..a7edf1ca 100644 } diff --git a/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcome.ts b/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcome.ts -index e31e406c..3ef69f71 100644 +index e31e406c478..3ef69f71be0 100644 --- a/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcome.ts +++ b/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcome.ts @@ -42,7 +42,7 @@ import { ACTION_ID_NEW_CHAT } from '../../chat/browser/actions/chatActions.js'; @@ -345,7 +345,7 @@ index e31e406c..3ef69f71 100644 private container!: HTMLElement; private contentContainer!: HTMLElement; diff --git a/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.ts b/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.ts -index 4057dedf..de88c08b 100644 +index 4057dedfa68..de88c08b6ee 100644 --- a/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.ts +++ b/src/vs/workbench/contrib/welcomeAgentSessions/browser/agentSessionsWelcomeInput.ts @@ -11,6 +11,7 @@ import { IUntypedEditorInput } from '../../../common/editor.js'; @@ -357,7 +357,7 @@ index 4057dedf..de88c08b 100644 export type AgentSessionsWelcomeWorkspaceKind = 'empty' | 'folder' | 'workspace'; diff --git a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts -index f90937e6..0b9fb3a1 100644 +index f90937e6a1f..0b9fb3a1e2d 100644 --- a/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts +++ b/src/vs/workbench/contrib/welcomeGettingStarted/browser/gettingStarted.contribution.ts @@ -32,7 +32,7 @@ import { Categories } from '../../../../platform/action/common/actionCommonCateg @@ -378,6 +378,3 @@ index f90937e6..0b9fb3a1 100644 return; } else { if (walkthroughID) { --- -2.39.5 (Apple Git-154) - diff --git a/vscode-patches/0110-refactor-split-extension-host-contribution-per-featu.patch b/vscode-patches/0109-refactor-split-extension-host-contribution-per-featu.patch similarity index 98% rename from vscode-patches/0110-refactor-split-extension-host-contribution-per-featu.patch rename to vscode-patches/0109-refactor-split-extension-host-contribution-per-featu.patch index 014efee7..dd7d225a 100644 --- a/vscode-patches/0110-refactor-split-extension-host-contribution-per-featu.patch +++ b/vscode-patches/0109-refactor-split-extension-host-contribution-per-featu.patch @@ -22,7 +22,7 @@ Co-Authored-By: Claude Opus 5.5 diff --git a/src/vs/workbench/api/browser/extensionHost.base.contribution.ts b/src/vs/workbench/api/browser/extensionHost.base.contribution.ts new file mode 100644 -index 00000000..bb2c5531 +index 00000000000..bb2c55317cd --- /dev/null +++ b/src/vs/workbench/api/browser/extensionHost.base.contribution.ts @@ -0,0 +1,90 @@ @@ -118,7 +118,7 @@ index 00000000..bb2c5531 +import './mainThreadBrowsers.js'; diff --git a/src/vs/workbench/api/browser/extensionHost.chat.contribution.ts b/src/vs/workbench/api/browser/extensionHost.chat.contribution.ts new file mode 100644 -index 00000000..c319d415 +index 00000000000..c319d41523d --- /dev/null +++ b/src/vs/workbench/api/browser/extensionHost.chat.contribution.ts @@ -0,0 +1,16 @@ @@ -139,7 +139,7 @@ index 00000000..c319d415 +import './mainThreadChatInputNotification.js'; +import './mainThreadChatSessions.js'; diff --git a/src/vs/workbench/api/browser/extensionHost.contribution.ts b/src/vs/workbench/api/browser/extensionHost.contribution.ts -index 82aee03d..93e9b81f 100644 +index 82aee03d809..93e9b81f389 100644 --- a/src/vs/workbench/api/browser/extensionHost.contribution.ts +++ b/src/vs/workbench/api/browser/extensionHost.contribution.ts @@ -3,104 +3,7 @@ @@ -253,7 +253,7 @@ index 82aee03d..93e9b81f 100644 +import './extensionHost.mcp.contribution.js'; diff --git a/src/vs/workbench/api/browser/extensionHost.mcp.contribution.ts b/src/vs/workbench/api/browser/extensionHost.mcp.contribution.ts new file mode 100644 -index 00000000..570c524a +index 00000000000..570c524a2b3 --- /dev/null +++ b/src/vs/workbench/api/browser/extensionHost.mcp.contribution.ts @@ -0,0 +1,7 @@ @@ -266,7 +266,7 @@ index 00000000..570c524a +import './mainThreadMcp.js'; diff --git a/src/vs/workbench/api/browser/extensionHost.notebook.contribution.ts b/src/vs/workbench/api/browser/extensionHost.notebook.contribution.ts new file mode 100644 -index 00000000..ff2f3cc2 +index 00000000000..ff2f3cc282c --- /dev/null +++ b/src/vs/workbench/api/browser/extensionHost.notebook.contribution.ts @@ -0,0 +1,11 @@ @@ -281,6 +281,3 @@ index 00000000..ff2f3cc2 +import './mainThreadNotebookDocumentsAndEditors.js'; +import './mainThreadNotebookRenderers.js'; +import './mainThreadNotebookSaveParticipant.js'; --- -2.39.5 (Apple Git-154) - From 2a7c4024c271724a86b2e1ec6e32467c563601aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Tue, 29 Sep 2026 10:14:54 +0200 Subject: [PATCH 30/35] lib: update monaco-editor --- package.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index cedadb83..2e690425 100644 --- a/package.json +++ b/package.json @@ -39,8 +39,8 @@ "commit": "7debcd0e2acdea1c52de81bf9ee1620444407dda" }, "monaco": { - "ref": "v0.56.0", - "version": "0.56.0" + "ref": "v0.57.0", + "version": "0.57.0" } }, "devDependencies": { From a3692433be8f18f0acf6bf265cbc45e493ea1068 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Tue, 29 Sep 2026 12:34:28 +0200 Subject: [PATCH 31/35] fix: improve code splitting --- rollup/rollup.config.ts | 2 +- src/missing-services.ts | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/rollup/rollup.config.ts b/rollup/rollup.config.ts index 2ad0e39e..4915844b 100644 --- a/rollup/rollup.config.ts +++ b/rollup/rollup.config.ts @@ -210,7 +210,7 @@ export default (args: Record): rollup.RollupOptions => { featureModules: /\/vs\/workbench\/contrib\/(chat|notebook|mcp)\/(?!.*\.service\.js$)/, // Service overrides that build on top of those features allowedEntries: - /\/src\/service-override\/(chat|notebook|mcp|interactive|ai|speech|welcome)\.ts$/, + /\/src\/service-override\/(?:(?:chat|notebook|mcp|interactive|ai|speech|welcome)(?:\/(?:common|classic|session))?|(?:viewCommon|workbench)\/session)\.ts$/, // ~910KB with VSCode 1.138: mostly dictation, go to symbol in chat, editor tabs and chat context keys maxSize: 1000 * 1024 }), diff --git a/src/missing-services.ts b/src/missing-services.ts index af663424..0d4ee70d 100644 --- a/src/missing-services.ts +++ b/src/missing-services.ts @@ -467,7 +467,6 @@ import { IChatSubmitRequestHandlerService } from 'vs/workbench/contrib/chat/brow import { IChatTipService } from 'vs/workbench/contrib/chat/browser/chatTipService.service.js' import { IChatContextService } from 'vs/workbench/contrib/chat/browser/contextContrib/chatContextService.service' import { IChatModelFeedbackSurveyService } from 'vs/workbench/contrib/chat/browser/feedbackSurvey/chatModelFeedbackSurveyService.service' -import { ChatSpeechToTextState } from 'vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService' import { IChatSpeechToTextService } from 'vs/workbench/contrib/chat/browser/speechToText/chatSpeechToTextService.service' import { IDictationOnboardingService } from 'vs/workbench/contrib/chat/browser/speechToText/dictationOnboarding.service' import { IVoiceCodeTranscriptionClient } from 'vs/workbench/contrib/chat/browser/speechToText/voiceCodeTranscriptionClient.service' @@ -8210,7 +8209,7 @@ registerSingleton(IChatSideChatService, ChatSideChatService, InstantiationType.D class ChatSpeechToTextService implements IChatSpeechToTextService { _serviceBrand: undefined onDidChangeState: IChatSpeechToTextService['onDidChangeState'] = Event.None - state: IChatSpeechToTextService['state'] = ChatSpeechToTextState.Idle + state: IChatSpeechToTextService['state'] = 'idle' as IChatSpeechToTextService['state'] isBusy: IChatSpeechToTextService['isBusy'] = false currentSurface: IChatSpeechToTextService['currentSurface'] = 'chat' onDidUpdateTranscript: IChatSpeechToTextService['onDidUpdateTranscript'] = Event.None From 8aafbaa2b82dbe4d7c40688c173c911a795b018f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Tue, 29 Sep 2026 12:35:51 +0200 Subject: [PATCH 32/35] fix: split shared modules by external dependencies --- rollup/plugins/rollup-subpackage-plugin.ts | 35 ++++++++++++++-------- 1 file changed, 23 insertions(+), 12 deletions(-) diff --git a/rollup/plugins/rollup-subpackage-plugin.ts b/rollup/plugins/rollup-subpackage-plugin.ts index 1107cefe..e19c5365 100644 --- a/rollup/plugins/rollup-subpackage-plugin.ts +++ b/rollup/plugins/rollup-subpackage-plugin.ts @@ -367,10 +367,13 @@ export default ({ if (groups.size === 0) { continue } - const groupSetKey = computeGroupListKey( - // if the module is referenced from the main package, just ignore the other ones - groups - ) + // Keep entry packages together, but split shared packages by their external dependencies. + // Otherwise one module depending on e.g. katex moves every module shared by the same groups + // into the katex common package. + const groupSetKey = JSON.stringify([ + Array.from(groups).sort(), + groups.size === 1 ? [] : Array.from(mainModule.transitiveExternalDependencies).sort() + ]) let groupSet = groupSetMap.get(groupSetKey) if (groupSet == null) { groupSet = { @@ -404,15 +407,8 @@ export default ({ const setEquals = (a: Set, b: Set) => { return a.size === b.size && includesAll(a, b) } - const isIncluded = (a: GroupSet, b: GroupSet) => { - return ( - includesAll(a.groups, b.groups) && - includesAll(a.transitiveExternalDependencies, b.transitiveExternalDependencies) - ) - } const areMergeable = (a: GroupSet, b: GroupSet) => { - if (setEquals(a.transitiveExternalDependencies, b.transitiveExternalDependencies)) return true - return isIncluded(a, b) || isIncluded(b, a) + return setEquals(a.transitiveExternalDependencies, b.transitiveExternalDependencies) } const merge = (a: GroupSet, b: GroupSet): GroupSet => { return { @@ -463,6 +459,21 @@ export default ({ } } + // Different dependency sets may still map to the same specialized common package. Merge them + // only after dependency-compatible modules have been moved to the main package, otherwise a + // package such as katex-common also absorbs shared modules that do not depend on katex. + const commonPackages = new Map() + for (const groupSet of combinationGroupSets) { + const packageName = getGroupSetName.call( + this, + groupSet.groups, + groupSet.transitiveExternalDependencies + ).name + const existing = commonPackages.get(packageName) + commonPackages.set(packageName, existing == null ? groupSet : merge(existing, groupSet)) + } + combinationGroupSets = Array.from(commonPackages.values()) + const compareGroupSets = firstBy((groupset: GroupSet) => groupset.groups.size).thenBy( (groupset: GroupSet) => computeGroupListKey(groupset.groups) ) From 58a38bfb8002aa357cfa9794120e3df771c5407e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Tue, 29 Sep 2026 15:36:06 +0200 Subject: [PATCH 33/35] fix: sort css files --- rollup/tools/vscode.ts | 13 +++++++++++-- src/css.ts | 13 +++++++++---- 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/rollup/tools/vscode.ts b/rollup/tools/vscode.ts index fc220d19..5edbf478 100644 --- a/rollup/tools/vscode.ts +++ b/rollup/tools/vscode.ts @@ -214,9 +214,15 @@ export default { visitImportDeclaration(path) { const node = path.node + const importPath = node.source.value as string + const importedId = nodePath.relative( + VSCODE_SRC_DIR, + nodePath.resolve(nodePath.dirname(id), importPath) + ) + if ( (node.specifiers == null || node.specifiers.length === 0) && - (node.source.value as string).endsWith('.css') + importPath.endsWith('.css') ) { const varName = `css${cssImportCounter++}` node.specifiers = [ @@ -224,7 +230,10 @@ export default { ] const injectCall = recast.types.builders.expressionStatement( recast.types.builders.callExpression(recast.types.builders.identifier('registerCss'), [ - recast.types.builders.identifier(varName) + recast.types.builders.identifier(varName), + // put contrib css files at last + // We need it for instance so that vs/workbench/browser/parts/auxiliarybar/media/auxiliaryBarPart.css is before vs/workbench/contrib/chat/browser/widget/media/chat.css + recast.types.builders.numericLiteral(importedId.includes('contrib/') ? 1 : 0) ]) ) diff --git a/src/css.ts b/src/css.ts index f08e38be..5d64373f 100644 --- a/src/css.ts +++ b/src/css.ts @@ -1,8 +1,11 @@ import { mainWindow } from 'vs/base/browser/window' -const sheets: CSSStyleSheet[] = [] +const sheets: { sheet: CSSStyleSheet; order: number }[] = [] -export function registerCss(module: { default?: string | CSSStyleSheet } | undefined) { +export function registerCss( + module: { default?: string | CSSStyleSheet } | undefined, + order: number = 0 +) { const exportedValue = module?.default let sheet: CSSStyleSheet | undefined = undefined @@ -41,7 +44,7 @@ export function registerCss(module: { default?: string | CSSStyleSheet } | undef }) } if (sheet != null) { - sheets.push(sheet) + sheets.push({ sheet, order }) } } function getInjectElement(target: HTMLElement) { @@ -60,5 +63,7 @@ export function injectCss(target: HTMLElement) { ) } - root.adoptedStyleSheets = [...root.adoptedStyleSheets, ...sheets] + sheets.sort((a, b) => a.order - b.order) + + root.adoptedStyleSheets = [...root.adoptedStyleSheets, ...sheets.map((s) => s.sheet)] } From 3cbdf8f094d19ea476f76c69142e25ab89383385 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Tue, 29 Sep 2026 18:42:56 +0200 Subject: [PATCH 34/35] fix: keep exporting interface & classes from service overrides --- src/service-override/chat/classic.ts | 2 +- src/service-override/chat/session.ts | 1 + src/service-override/editor/classic.ts | 2 ++ src/service-override/telemetry/classic.ts | 1 + src/service-override/telemetry/session.ts | 1 + src/service-override/views/classic.ts | 1 + 6 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/service-override/chat/classic.ts b/src/service-override/chat/classic.ts index ad643675..7f083748 100644 --- a/src/service-override/chat/classic.ts +++ b/src/service-override/chat/classic.ts @@ -22,7 +22,7 @@ import { type IChatEntitlementContextState } from 'vs/workbench/services/chat/common/chatEntitlementService' import getCommonServiceOverride, { type ChatServiceOverrideOptions } from './common.js' -export type { ITelemetryData, TelemetryLevel } from 'vs/platform/telemetry/common/telemetry' +export * from './common.js' import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHost.contribution' import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentHostSettings.contribution' import 'vs/workbench/contrib/chat/browser/agentSessions/agentHost/agentSessionSettings.contribution' diff --git a/src/service-override/chat/session.ts b/src/service-override/chat/session.ts index 79533ac0..b120d2c1 100644 --- a/src/service-override/chat/session.ts +++ b/src/service-override/chat/session.ts @@ -23,6 +23,7 @@ import { IChatResponseFileChangesService } from 'vs/workbench/contrib/chat/brows import { SessionsChatResponseFileChangesService } from 'vs/sessions/contrib/chat/browser/sessionTurnChanges.js' import { IChangesViewService } from 'vs/sessions/contrib/changes/common/changesViewService.service.js' import { ChangesViewService } from 'vs/sessions/contrib/changes/browser/changesViewService' +export * from './common.js' import 'vs/sessions/contrib/chat/browser/btwSlashCommand.contribution' import 'vs/sessions/contrib/chat/browser/chat.contribution' diff --git a/src/service-override/editor/classic.ts b/src/service-override/editor/classic.ts index 3d7717b9..f20f13c0 100644 --- a/src/service-override/editor/classic.ts +++ b/src/service-override/editor/classic.ts @@ -188,4 +188,6 @@ export default function getServiceOverride(openEditor: OpenEditor): IEditorOverr } } +export { MonacoEditorService } + export type { IEditorOptions, IReference, IResolvedTextEditorModel, OpenEditor } diff --git a/src/service-override/telemetry/classic.ts b/src/service-override/telemetry/classic.ts index d0cbd00f..3d4b5b57 100644 --- a/src/service-override/telemetry/classic.ts +++ b/src/service-override/telemetry/classic.ts @@ -1,3 +1,4 @@ export { default } from './common' +export * from './common' import 'vs/workbench/services/policies/browser/policyTelemetry.contribution' import 'vs/workbench/contrib/bracketPairColorizer2Telemetry/browser/bracketPairColorizer2Telemetry.contribution.js' diff --git a/src/service-override/telemetry/session.ts b/src/service-override/telemetry/session.ts index 4a864cf7..4ecc81bc 100644 --- a/src/service-override/telemetry/session.ts +++ b/src/service-override/telemetry/session.ts @@ -1 +1,2 @@ export { default } from './common' +export * from './common' diff --git a/src/service-override/views/classic.ts b/src/service-override/views/classic.ts index 0f315f03..85c38605 100644 --- a/src/service-override/views/classic.ts +++ b/src/service-override/views/classic.ts @@ -859,6 +859,7 @@ function getServiceOverride( export default getServiceOverride export { + MonacoEditorService, ActivityService, ActivitybarPart, GroupOrientation, From 7aafd37a3117d4ac805e44f11ec291b295f22c28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Wed, 30 Sep 2026 11:41:07 +0200 Subject: [PATCH 35/35] fix: remove "open in vscode" buttons --- src/override/vs/sessions/browser/sessions.web.contribution.ts | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 src/override/vs/sessions/browser/sessions.web.contribution.ts diff --git a/src/override/vs/sessions/browser/sessions.web.contribution.ts b/src/override/vs/sessions/browser/sessions.web.contribution.ts new file mode 100644 index 00000000..a194b03b --- /dev/null +++ b/src/override/vs/sessions/browser/sessions.web.contribution.ts @@ -0,0 +1,2 @@ +// remove vscode contribution that only contain "open in vscode" buttons +export {}