diff --git a/package.json b/package.json index 7fb7d71297e..efb504f4ffd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "code-oss-dev", - "version": "1.107.0", + "version": "1.107.20251119", "distro": "3ee33b7862b5e018538b730ae631f35747f57a2c", "author": { "name": "Microsoft Corporation" diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts index 9ff9ae19615..8c3b369982d 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatController.ts @@ -129,12 +129,11 @@ export class InlineChatController implements IEditorContribution { @IConfigurationService configurationService: IConfigurationService, @INotebookEditorService private readonly _notebookEditorService: INotebookEditorService ) { - const inlineChat2 = observableConfigValue(InlineChatConfigKeys.EnableV2, false, configurationService); const notebookAgent = observableConfigValue(InlineChatConfigKeys.notebookAgent, false, configurationService); this._delegate = derived(r => { const isNotebookCell = !!this._notebookEditorService.getNotebookForPossibleCell(editor); - if (isNotebookCell ? notebookAgent.read(r) : inlineChat2.read(r)) { + if (!isNotebookCell || notebookAgent.read(r)) { return InlineChatController2.get(editor)!; } else { return InlineChatController1.get(editor)!; @@ -1406,6 +1405,19 @@ export class InlineChatController2 implements IEditorContribution { } })); + this._store.add(autorun(r => { + const session = visibleSessionObs.read(r); + if (session) { + const entries = session.editingSession.entries.read(r); + const otherEntries = entries.filter(entry => !isEqual(entry.modifiedURI, session.uri)); + for (const entry of otherEntries) { + // OPEN other modified files in side group. This is a workaround, temp-solution until we have no more backend + // that modifies other files + this._editorService.openEditor({ resource: entry.modifiedURI }, SIDE_GROUP).catch(onUnexpectedError); + } + } + })); + this._store.add(autorun(r => { const session = visibleSessionObs.read(r); if (!session) { diff --git a/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts b/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts index a9b3a43c184..d553be901bc 100644 --- a/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts +++ b/src/vs/workbench/contrib/inlineChat/browser/inlineChatSessionServiceImpl.ts @@ -41,7 +41,7 @@ import { ModifiedFileEntryState } from '../../chat/common/chatEditingService.js' import { IChatService } from '../../chat/common/chatService.js'; import { ChatAgentLocation } from '../../chat/common/constants.js'; import { ILanguageModelToolsService, ToolDataSource, IToolData } from '../../chat/common/languageModelToolsService.js'; -import { CTX_INLINE_CHAT_HAS_AGENT, CTX_INLINE_CHAT_HAS_AGENT2, CTX_INLINE_CHAT_HAS_NOTEBOOK_AGENT, CTX_INLINE_CHAT_HAS_NOTEBOOK_INLINE, CTX_INLINE_CHAT_POSSIBLE, InlineChatConfigKeys } from '../common/inlineChat.js'; +import { CTX_INLINE_CHAT_HAS_AGENT2, CTX_INLINE_CHAT_HAS_NOTEBOOK_AGENT, CTX_INLINE_CHAT_HAS_NOTEBOOK_INLINE, CTX_INLINE_CHAT_POSSIBLE, InlineChatConfigKeys } from '../common/inlineChat.js'; import { HunkData, Session, SessionWholeRange, StashedSession, TelemetryData, TelemetryDataClassification } from './inlineChatSession.js'; import { askInPanelChat, IInlineChatSession2, IInlineChatSessionEndEvent, IInlineChatSessionEvent, IInlineChatSessionService, ISessionKeyComputer } from './inlineChatSessionService.js'; @@ -440,7 +440,6 @@ export class InlineChatEnabler { static Id = 'inlineChat.enabler'; - private readonly _ctxHasProvider: IContextKey; private readonly _ctxHasProvider2: IContextKey; private readonly _ctxHasNotebookInline: IContextKey; private readonly _ctxHasNotebookProvider: IContextKey; @@ -454,29 +453,21 @@ export class InlineChatEnabler { @IEditorService editorService: IEditorService, @IConfigurationService configService: IConfigurationService, ) { - this._ctxHasProvider = CTX_INLINE_CHAT_HAS_AGENT.bindTo(contextKeyService); this._ctxHasProvider2 = CTX_INLINE_CHAT_HAS_AGENT2.bindTo(contextKeyService); this._ctxHasNotebookInline = CTX_INLINE_CHAT_HAS_NOTEBOOK_INLINE.bindTo(contextKeyService); this._ctxHasNotebookProvider = CTX_INLINE_CHAT_HAS_NOTEBOOK_AGENT.bindTo(contextKeyService); this._ctxPossible = CTX_INLINE_CHAT_POSSIBLE.bindTo(contextKeyService); const agentObs = observableFromEvent(this, chatAgentService.onDidChangeAgents, () => chatAgentService.getDefaultAgent(ChatAgentLocation.EditorInline)); - const inlineChat2Obs = observableConfigValue(InlineChatConfigKeys.EnableV2, false, configService); const notebookAgentObs = observableFromEvent(this, chatAgentService.onDidChangeAgents, () => chatAgentService.getDefaultAgent(ChatAgentLocation.Notebook)); const notebookAgentConfigObs = observableConfigValue(InlineChatConfigKeys.notebookAgent, false, configService); this._store.add(autorun(r => { - const v2 = inlineChat2Obs.read(r); const agent = agentObs.read(r); if (!agent) { - this._ctxHasProvider.reset(); this._ctxHasProvider2.reset(); - } else if (v2) { - this._ctxHasProvider.reset(); - this._ctxHasProvider2.set(true); } else { - this._ctxHasProvider.set(true); - this._ctxHasProvider2.reset(); + this._ctxHasProvider2.set(true); } })); @@ -497,7 +488,7 @@ export class InlineChatEnabler { dispose() { this._ctxPossible.reset(); - this._ctxHasProvider.reset(); + this._ctxHasProvider2.reset(); this._store.dispose(); } } diff --git a/src/vs/workbench/contrib/inlineChat/common/inlineChat.ts b/src/vs/workbench/contrib/inlineChat/common/inlineChat.ts index 6517d062eaa..fca123489d9 100644 --- a/src/vs/workbench/contrib/inlineChat/common/inlineChat.ts +++ b/src/vs/workbench/contrib/inlineChat/common/inlineChat.ts @@ -18,6 +18,7 @@ export const enum InlineChatConfigKeys { StartWithOverlayWidget = 'inlineChat.startWithOverlayWidget', HoldToSpeech = 'inlineChat.holdToSpeech', AccessibleDiffView = 'inlineChat.accessibleDiffView', + /** @deprecated do not read on client */ EnableV2 = 'inlineChat.enableV2', notebookAgent = 'inlineChat.notebookAgent', } @@ -80,7 +81,8 @@ export const enum InlineChatResponseType { } export const CTX_INLINE_CHAT_POSSIBLE = new RawContextKey('inlineChatPossible', false, localize('inlineChatHasPossible', "Whether a provider for inline chat exists and whether an editor for inline chat is open")); -export const CTX_INLINE_CHAT_HAS_AGENT = new RawContextKey('inlineChatHasProvider', false, localize('inlineChatHasProvider', "Whether a provider for interactive editors exists")); +/** @deprecated */ +const CTX_INLINE_CHAT_HAS_AGENT = new RawContextKey('inlineChatHasProvider', false, localize('inlineChatHasProvider', "Whether a provider for interactive editors exists")); export const CTX_INLINE_CHAT_HAS_AGENT2 = new RawContextKey('inlineChatHasEditsAgent', false, localize('inlineChatHasEditsAgent', "Whether an agent for inline for interactive editors exists")); export const CTX_INLINE_CHAT_HAS_NOTEBOOK_INLINE = new RawContextKey('inlineChatHasNotebookInline', false, localize('inlineChatHasNotebookInline', "Whether an agent for notebook cells exists")); export const CTX_INLINE_CHAT_HAS_NOTEBOOK_AGENT = new RawContextKey('inlineChatHasNotebookAgent', false, localize('inlineChatHasNotebookAgent', "Whether an agent for notebook cells exists"));