Use new inline chat UI all the time (#278139)

* Don't read `inlineChat.enableV2` on the client anymore

The UI is now always the new way but the extension still supports both "back ends"

re https://github.com/microsoft/vscode/issues/278054

* handle graceful files, e.g from /test, graceful

* use artifical version number to make chat happy with code-oss
This commit is contained in:
Johannes Rieken
2025-11-18 17:34:39 +01:00
committed by GitHub
parent bae96a07ac
commit 77becee660
4 changed files with 21 additions and 16 deletions

View File

@@ -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) {