mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-21 17:19:01 +01:00
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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user