diff --git a/vscode-paches/0055-fix-extract-constants-into-separate-module.patch b/vscode-paches/0055-fix-extract-constants-into-separate-module.patch new file mode 100644 index 00000000..79847839 --- /dev/null +++ b/vscode-paches/0055-fix-extract-constants-into-separate-module.patch @@ -0,0 +1,142 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= +Date: Tue, 22 Oct 2024 13:04:46 +0200 +Subject: [PATCH] fix: extract constants into separate module + +so that only the constant is pulled from the root instead of the whole module graph +--- + src/vs/workbench/api/browser/mainThreadChatAgents2.ts | 5 +++-- + .../contrib/chat/browser/actions/chatActions.ts | 5 ++--- + .../contrib/chat/browser/actions/chatConstants.ts | 10 ++++++++++ + .../chat/browser/actions/chatQuickInputActions.ts | 3 ++- + .../chat/browser/contrib/chatDynamicVariables.ts | 3 ++- + .../browser/contrib/chatDynamicVariablesConstant.ts | 6 ++++++ + .../contrib/quickaccess/browser/commandsQuickAccess.ts | 3 +-- + 7 files changed, 26 insertions(+), 9 deletions(-) + create mode 100644 src/vs/workbench/contrib/chat/browser/actions/chatConstants.ts + create mode 100644 src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariablesConstant.ts + +diff --git a/src/vs/workbench/api/browser/mainThreadChatAgents2.ts b/src/vs/workbench/api/browser/mainThreadChatAgents2.ts +index 5de097d706d..b8fe352d99f 100644 +--- a/src/vs/workbench/api/browser/mainThreadChatAgents2.ts ++++ b/src/vs/workbench/api/browser/mainThreadChatAgents2.ts +@@ -23,7 +23,7 @@ import { IInstantiationService } from '../../../platform/instantiation/common/in + import { ILogService } from '../../../platform/log/common/log.js'; + import { IChatWidgetService } from '../../contrib/chat/browser/chat.js'; + import { ChatInputPart } from '../../contrib/chat/browser/chatInputPart.js'; +-import { AddDynamicVariableAction, IAddDynamicVariableContext } from '../../contrib/chat/browser/contrib/chatDynamicVariables.js'; ++import { IAddDynamicVariableContext } from '../../contrib/chat/browser/contrib/chatDynamicVariables.js'; + import { ChatAgentLocation, IChatAgentHistoryEntry, IChatAgentImplementation, IChatAgentRequest, IChatAgentService } from '../../contrib/chat/common/chatAgents.js'; + import { ChatRequestAgentPart } from '../../contrib/chat/common/chatParserTypes.js'; + import { ChatRequestParser } from '../../contrib/chat/common/chatRequestParser.js'; +@@ -32,6 +32,7 @@ import { IExtHostContext, extHostNamedCustomer } from '../../services/extensions + import { IExtensionService } from '../../services/extensions/common/extensions.js'; + import { Dto } from '../../services/extensions/common/proxyIdentifier.js'; + import { ExtHostChatAgentsShape2, ExtHostContext, IChatParticipantMetadata, IChatProgressDto, IDynamicChatAgentProps, IExtensionChatAgentMetadata, MainContext, MainThreadChatAgentsShape2 } from '../common/extHost.protocol.js'; ++import { addDynamicVariableActionId } from '../../contrib/chat/browser/contrib/chatDynamicVariablesConstant.js'; + + interface AgentData { + dispose: () => void; +@@ -313,7 +314,7 @@ export class MainThreadChatAgents2 extends Disposable implements MainThreadChatA + kind: CompletionItemKind.Text, + detail: v.detail, + documentation: v.documentation, +- command: { id: AddDynamicVariableAction.ID, title: '', arguments: [{ id: v.id, widget, range: rangeAfterInsert, variableData: revive(v.value) as any, command: v.command } satisfies IAddDynamicVariableContext] } ++ command: { id: addDynamicVariableActionId, title: '', arguments: [{ id: v.id, widget, range: rangeAfterInsert, variableData: revive(v.value) as any, command: v.command } satisfies IAddDynamicVariableContext] } + } satisfies CompletionItem; + }); + +diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts b/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts +index 3b308d96078..0705038398a 100644 +--- a/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts ++++ b/src/vs/workbench/contrib/chat/browser/actions/chatActions.ts +@@ -49,9 +49,8 @@ import { URI } from '../../../../../base/common/uri.js'; + import { IHostService } from '../../../../services/host/browser/host.js'; + import { isCancellationError } from '../../../../../base/common/errors.js'; + import { ITelemetryService } from '../../../../../platform/telemetry/common/telemetry.js'; +- +-export const CHAT_CATEGORY = localize2('chat.category', 'Chat'); +-export const CHAT_OPEN_ACTION_ID = 'workbench.action.chat.open'; ++import { CHAT_CATEGORY, CHAT_OPEN_ACTION_ID } from './chatConstants.js'; ++export { CHAT_CATEGORY, CHAT_OPEN_ACTION_ID } from './chatConstants.js'; + + export interface IChatViewOpenOptions { + /** +diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatConstants.ts b/src/vs/workbench/contrib/chat/browser/actions/chatConstants.ts +new file mode 100644 +index 00000000000..6ce67486a58 +--- /dev/null ++++ b/src/vs/workbench/contrib/chat/browser/actions/chatConstants.ts +@@ -0,0 +1,10 @@ ++/*--------------------------------------------------------------------------------------------- ++ * Copyright (c) Microsoft Corporation. All rights reserved. ++ * Licensed under the MIT License. See License.txt in the project root for license information. ++ *--------------------------------------------------------------------------------------------*/ ++import { localize2 } from '../../../../../nls.js'; ++ ++export const CHAT_CATEGORY = localize2('chat.category', 'Chat'); ++export const CHAT_OPEN_ACTION_ID = 'workbench.action.chat.open'; ++export const ASK_QUICK_QUESTION_ACTION_ID = 'workbench.action.quickchat.toggle'; ++ +diff --git a/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.ts b/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.ts +index 43b7bf8b6fa..91987dc1493 100644 +--- a/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.ts ++++ b/src/vs/workbench/contrib/chat/browser/actions/chatQuickInputActions.ts +@@ -15,8 +15,9 @@ import { CHAT_CATEGORY } from './chatActions.js'; + import { IQuickChatOpenOptions, IQuickChatService } from '../chat.js'; + import { CONTEXT_CHAT_ENABLED } from '../../common/chatContextKeys.js'; + import { InlineChatController } from '../../../inlineChat/browser/inlineChatController.js'; ++import { ASK_QUICK_QUESTION_ACTION_ID } from './chatConstants.js'; ++export { ASK_QUICK_QUESTION_ACTION_ID } from './chatConstants.js'; + +-export const ASK_QUICK_QUESTION_ACTION_ID = 'workbench.action.quickchat.toggle'; + export function registerQuickChatActions() { + registerAction2(QuickChatGlobalAction); + registerAction2(AskQuickChatAction); +diff --git a/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.ts b/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.ts +index 29977605ad3..1377fcea1f0 100644 +--- a/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.ts ++++ b/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariables.ts +@@ -23,6 +23,7 @@ import { IQuickInputService } from '../../../../../platform/quickinput/common/qu + import { IChatWidget } from '../chat.js'; + import { ChatWidget, IChatWidgetContrib } from '../chatWidget.js'; + import { IChatRequestVariableValue, IChatVariablesService, IDynamicVariable } from '../../common/chatVariables.js'; ++import { addDynamicVariableActionId } from './chatDynamicVariablesConstant.js'; + + export const dynamicVariableDecorationType = 'chat-dynamic-variable'; + +@@ -232,7 +233,7 @@ function isAddDynamicVariableContext(context: any): context is IAddDynamicVariab + } + + export class AddDynamicVariableAction extends Action2 { +- static readonly ID = 'workbench.action.chat.addDynamicVariable'; ++ static readonly ID = addDynamicVariableActionId; + + constructor() { + super({ +diff --git a/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariablesConstant.ts b/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariablesConstant.ts +new file mode 100644 +index 00000000000..df0794493a8 +--- /dev/null ++++ b/src/vs/workbench/contrib/chat/browser/contrib/chatDynamicVariablesConstant.ts +@@ -0,0 +1,6 @@ ++/*--------------------------------------------------------------------------------------------- ++ * Copyright (c) Microsoft Corporation. All rights reserved. ++ * Licensed under the MIT License. See License.txt in the project root for license information. ++ *--------------------------------------------------------------------------------------------*/ ++ ++export const addDynamicVariableActionId = 'workbench.action.chat.addDynamicVariable'; +diff --git a/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.ts b/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.ts +index 3ab1684b9ac..a91549c6daf 100644 +--- a/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.ts ++++ b/src/vs/workbench/contrib/quickaccess/browser/commandsQuickAccess.ts +@@ -30,8 +30,7 @@ import { IQuickInputService, IQuickPickSeparator } from '../../../../platform/qu + import { IStorageService } from '../../../../platform/storage/common/storage.js'; + import { ITelemetryService } from '../../../../platform/telemetry/common/telemetry.js'; + import { IWorkbenchQuickAccessConfiguration } from '../../../browser/quickaccess.js'; +-import { CHAT_OPEN_ACTION_ID } from '../../chat/browser/actions/chatActions.js'; +-import { ASK_QUICK_QUESTION_ACTION_ID } from '../../chat/browser/actions/chatQuickInputActions.js'; ++import { CHAT_OPEN_ACTION_ID, ASK_QUICK_QUESTION_ACTION_ID } from '../../chat/browser/actions/chatConstants.js'; + import { ChatAgentLocation, IChatAgentService } from '../../chat/common/chatAgents.js'; + import { CommandInformationResult, IAiRelatedInformationService, RelatedInformationType } from '../../../services/aiRelatedInformation/common/aiRelatedInformation.js'; + import { IEditorGroupsService } from '../../../services/editor/common/editorGroupsService.js'; diff --git a/vscode-paches/0056-fix-store-activeChatController-in-another-module.patch b/vscode-paches/0056-fix-store-activeChatController-in-another-module.patch new file mode 100644 index 00000000..099f3561 --- /dev/null +++ b/vscode-paches/0056-fix-store-activeChatController-in-another-module.patch @@ -0,0 +1,260 @@ +From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= +Date: Thu, 31 Oct 2024 12:20:04 +0100 +Subject: [PATCH] fix: store activeChatController in another module + +--- + .../contrib/chat/browser/chatWidget.ts | 4 +-- + .../actions/voiceChatActions.ts | 4 +-- + .../terminal/terminalContribChatExports.ts | 2 ++ + .../chat/browser/terminalChatActions.ts | 25 ++++++++++--------- + .../chat/browser/terminalChatController.ts | 11 +++----- + .../browser/terminalChatControllerHolder.ts | 15 +++++++++++ + 6 files changed, 38 insertions(+), 23 deletions(-) + create mode 100644 src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.ts + +diff --git a/src/vs/workbench/contrib/chat/browser/chatWidget.ts b/src/vs/workbench/contrib/chat/browser/chatWidget.ts +index c3da00e0968..10457719c43 100644 +--- a/src/vs/workbench/contrib/chat/browser/chatWidget.ts ++++ b/src/vs/workbench/contrib/chat/browser/chatWidget.ts +@@ -32,7 +32,7 @@ import { IStorageService, StorageScope, StorageTarget } from '../../../../platfo + import { buttonSecondaryBackground, buttonSecondaryForeground, buttonSecondaryHoverBackground } from '../../../../platform/theme/common/colorRegistry.js'; + import { asCssVariable } from '../../../../platform/theme/common/colorUtils.js'; + import { IThemeService } from '../../../../platform/theme/common/themeService.js'; +-import { TerminalChatController } from '../../terminal/terminalContribChatExports.js'; ++import { activeChatController } from '../../terminal/terminalContribChatExports.js'; + import { ChatAgentLocation, IChatAgentCommand, IChatAgentData, IChatAgentService, IChatWelcomeMessageContent, isChatWelcomeMessageContent } from '../common/chatAgents.js'; + import { CONTEXT_CHAT_INPUT_HAS_AGENT, CONTEXT_CHAT_LOCATION, CONTEXT_CHAT_REQUEST_IN_PROGRESS, CONTEXT_IN_CHAT_SESSION, CONTEXT_IN_QUICK_CHAT, CONTEXT_LAST_ITEM_ID, CONTEXT_RESPONSE_FILTERED } from '../common/chatContextKeys.js'; + import { ChatEditingSessionState, IChatEditingService, IChatEditingSession } from '../common/chatEditingService.js'; +@@ -1251,7 +1251,7 @@ export class ChatWidgetService extends Disposable implements IChatWidgetService + readonly onDidAddWidget: Event = this._onDidAddWidget.event; + + get lastFocusedWidget(): IChatWidget | undefined { +- return TerminalChatController.activeChatController?.chatWidget ?? this._lastFocusedWidget; ++ return activeChatController?.chatWidget ?? this._lastFocusedWidget; + } + + getAllWidgets(location: ChatAgentLocation): ReadonlyArray { +diff --git a/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts b/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts +index 3935d4ed235..9b2516c7c74 100644 +--- a/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts ++++ b/src/vs/workbench/contrib/chat/electron-sandbox/actions/voiceChatActions.ts +@@ -47,7 +47,7 @@ import { CTX_INLINE_CHAT_FOCUSED, MENU_INLINE_CHAT_WIDGET_SECONDARY } from '../. + import { NOTEBOOK_EDITOR_FOCUSED } from '../../../notebook/common/notebookContextKeys.js'; + import { HasSpeechProvider, ISpeechService, KeywordRecognitionStatus, SpeechToTextInProgress, SpeechToTextStatus, TextToSpeechStatus, TextToSpeechInProgress as GlobalTextToSpeechInProgress } from '../../../speech/common/speechService.js'; + import { ITerminalService } from '../../../terminal/browser/terminal.js'; +-import { TerminalChatContextKeys, TerminalChatController } from '../../../terminal/terminalContribChatExports.js'; ++import { TerminalChatContextKeys, TerminalChatController, activeChatController } from '../../../terminal/terminalContribChatExports.js'; + import { IEditorService } from '../../../../services/editor/common/editorService.js'; + import { IHostService } from '../../../../services/host/browser/host.js'; + import { IWorkbenchLayoutService, Parts } from '../../../../services/layout/browser/layoutService.js'; +@@ -148,7 +148,7 @@ class VoiceChatSessionControllerFactory { + // 1.) probe terminal chat which is not part of chat widget service + const activeInstance = terminalService.activeInstance; + if (activeInstance) { +- const terminalChat = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const terminalChat = activeChatController || TerminalChatController.get(activeInstance); + if (terminalChat?.hasFocus()) { + return VoiceChatSessionControllerFactory.doCreateForTerminalChat(terminalChat); + } +diff --git a/src/vs/workbench/contrib/terminal/terminalContribChatExports.ts b/src/vs/workbench/contrib/terminal/terminalContribChatExports.ts +index edd22bbfdc5..10e68ca6b62 100644 +--- a/src/vs/workbench/contrib/terminal/terminalContribChatExports.ts ++++ b/src/vs/workbench/contrib/terminal/terminalContribChatExports.ts +@@ -3,8 +3,10 @@ + * Licensed under the MIT License. See License.txt in the project root for license information. + *--------------------------------------------------------------------------------------------*/ + ++ + // HACK: Export chat parts as it's only partially encapsulated within the contrib. This file only + // exists because including it into terminalContribExports would cause a circular dependency on + // startup + export { TerminalChatContextKeys } from '../terminalContrib/chat/browser/terminalChat.js'; + export { TerminalChatController } from '../terminalContrib/chat/browser/terminalChatController.js'; ++export { activeChatController } from '../terminalContrib/chat/browser/terminalChatControllerHolder.js'; +diff --git a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts +index 885239c6009..23a46aa2556 100644 +--- a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts ++++ b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatActions.ts +@@ -16,6 +16,7 @@ import { registerActiveXtermAction } from '../../../terminal/browser/terminalAct + import { TerminalContextKeys } from '../../../terminal/common/terminalContextKey.js'; + import { MENU_TERMINAL_CHAT_INPUT, MENU_TERMINAL_CHAT_WIDGET, MENU_TERMINAL_CHAT_WIDGET_STATUS, TerminalChatCommandId, TerminalChatContextKeys } from './terminalChat.js'; + import { TerminalChatController } from './terminalChatController.js'; ++import { activeChatController } from './terminalChatControllerHolder.js'; + + registerActiveXtermAction({ + id: TerminalChatCommandId.Start, +@@ -37,7 +38,7 @@ registerActiveXtermAction({ + return; + } + +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + + if (opts) { + opts = typeof opts === 'string' ? { query: opts } : opts; +@@ -77,7 +78,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.clear(); + } + }); +@@ -105,7 +106,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.clear(); + } + }); +@@ -137,7 +138,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.acceptCommand(true); + } + }); +@@ -167,7 +168,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.acceptCommand(true); + } + }); +@@ -199,7 +200,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.acceptCommand(false); + } + }); +@@ -229,7 +230,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.acceptCommand(false); + } + }); +@@ -258,7 +259,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.viewInChat(); + } + }); +@@ -287,7 +288,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.acceptInput(); + } + }); +@@ -308,7 +309,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.cancel(); + } + }); +@@ -327,7 +328,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.populateHistory(true); + } + }); +@@ -346,7 +347,7 @@ registerActiveXtermAction({ + if (isDetachedTerminalInstance(activeInstance)) { + return; + } +- const contr = TerminalChatController.activeChatController || TerminalChatController.get(activeInstance); ++ const contr = activeChatController || TerminalChatController.get(activeInstance); + contr?.populateHistory(false); + } + }); +diff --git a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.ts b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.ts +index 17e77a4a945..4a97d085595 100644 +--- a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.ts ++++ b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController.ts +@@ -23,6 +23,7 @@ import { ChatAgentLocation } from '../../../chat/common/chatAgents.js'; + import { ChatModel, IChatResponseModel } from '../../../chat/common/chatModel.js'; + import type { ITerminalContributionContext } from '../../../terminal/browser/terminalExtensions.js'; + import { TerminalChatContextKeys } from './terminalChat.js'; ++import { setActiveChatController } from './terminalChatControllerHolder.js'; + + const enum Message { + None = 0, +@@ -37,15 +38,11 @@ const enum Message { + + export class TerminalChatController extends Disposable implements ITerminalContribution { + static readonly ID = 'terminal.chat'; ++ static activeChatController: TerminalChatController | null; + + static get(instance: ITerminalInstance): TerminalChatController | null { + return instance.getContribution(TerminalChatController.ID); + } +- /** +- * The controller for the currently focused chat widget. This is used to track action context since 'active terminals' +- * are only tracked for non-detached terminal instanecs. +- */ +- static activeChatController?: TerminalChatController; + + private static _storageKey = 'terminal-inline-chat-history'; + private static _promptHistory: string[] = []; +@@ -145,13 +142,13 @@ export class TerminalChatController extends Disposable implements ITerminalContr + this._terminalChatWidget = new Lazy(() => { + const chatWidget = this._register(this._instantiationService.createInstance(TerminalChatWidget, this._ctx.instance.domElement!, this._ctx.instance, xterm)); + this._register(chatWidget.focusTracker.onDidFocus(() => { +- TerminalChatController.activeChatController = this; ++ setActiveChatController(this); + if (!isDetachedTerminalInstance(this._ctx.instance)) { + this._terminalService.setActiveInstance(this._ctx.instance); + } + })); + this._register(chatWidget.focusTracker.onDidBlur(() => { +- TerminalChatController.activeChatController = undefined; ++ setActiveChatController(undefined); + this._ctx.instance.resetScrollbarVisibility(); + })); + if (!this._ctx.instance.domElement) { +diff --git a/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.ts b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.ts +new file mode 100644 +index 00000000000..bb67971614b +--- /dev/null ++++ b/src/vs/workbench/contrib/terminalContrib/chat/browser/terminalChatControllerHolder.ts +@@ -0,0 +1,15 @@ ++/*--------------------------------------------------------------------------------------------- ++ * Copyright (c) Microsoft Corporation. All rights reserved. ++ * Licensed under the MIT License. See License.txt in the project root for license information. ++ *--------------------------------------------------------------------------------------------*/ ++import { TerminalChatController } from './terminalChatController.js'; ++ ++/** ++ * The controller for the currently focused chat widget. This is used to track action context since 'active terminals' ++ * are only tracked for non-detached terminal instanecs. ++ */ ++export let activeChatController: TerminalChatController | undefined; ++ ++export function setActiveChatController(_activeChatController: TerminalChatController | undefined) { ++ activeChatController = _activeChatController; ++} diff --git a/vscode-paches/0055-fix-rollback-typescript-as-the-last-version-breaks-t.patch b/vscode-paches/0057-fix-rollback-typescript-as-the-last-version-breaks-t.patch similarity index 98% rename from vscode-paches/0055-fix-rollback-typescript-as-the-last-version-breaks-t.patch rename to vscode-paches/0057-fix-rollback-typescript-as-the-last-version-breaks-t.patch index b298b6df..4734742b 100644 --- a/vscode-paches/0055-fix-rollback-typescript-as-the-last-version-breaks-t.patch +++ b/vscode-paches/0057-fix-rollback-typescript-as-the-last-version-breaks-t.patch @@ -1,6 +1,6 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= -Date: Wed, 6 Nov 2024 19:49:31 +0100 +Date: Mon, 18 Nov 2024 14:04:14 +0100 Subject: [PATCH] fix: rollback typescript as the last version breaks the extractServices script