mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-12 17:48:19 +01:00
send and new session
This commit is contained in:
@@ -218,10 +218,8 @@ export class SessionsManagementService extends Disposable implements ISessionsMa
|
||||
return this._activeSession.get();
|
||||
}
|
||||
|
||||
async openSession(sessionResource: URI, openOptions?: ISessionOpenOptions & { hidden?: boolean }): Promise<void> {
|
||||
if (!openOptions?.hidden) {
|
||||
this.isNewChatSessionContext.set(false);
|
||||
}
|
||||
async openSession(sessionResource: URI, openOptions?: ISessionOpenOptions): Promise<void> {
|
||||
this.isNewChatSessionContext.set(false);
|
||||
const existingSession = this.agentSessionsService.model.getSession(sessionResource);
|
||||
if (existingSession) {
|
||||
await this.openExistingSession(existingSession, openOptions);
|
||||
@@ -311,7 +309,10 @@ export class SessionsManagementService extends Disposable implements ISessionsMa
|
||||
|
||||
private async doSendRequestForNewSession(session: INewSession, query: string, sendOptions: IChatSendRequestOptions, selectedOptions?: ReadonlyMap<string, IChatSessionProviderOptionItem>, openNewSessionView?: boolean): Promise<void> {
|
||||
// 1. Open the session - loads the model and shows the ChatViewPane
|
||||
await this.openSession(session.resource, openNewSessionView ? { hidden: true } : undefined);
|
||||
await this.openSession(session.resource);
|
||||
if (openNewSessionView) {
|
||||
this.openNewSessionView();
|
||||
}
|
||||
|
||||
// 2. Apply selected options (repository, branch, etc.) to the contributed session
|
||||
if (selectedOptions && selectedOptions.size > 0) {
|
||||
@@ -365,12 +366,8 @@ export class SessionsManagementService extends Disposable implements ISessionsMa
|
||||
listener?.dispose();
|
||||
}
|
||||
|
||||
if (newSession) {
|
||||
if (openNewSessionView) {
|
||||
this.openNewSessionView();
|
||||
} else {
|
||||
this.setActiveSession(newSession);
|
||||
}
|
||||
if (newSession && !openNewSessionView) {
|
||||
this.setActiveSession(newSession);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user