Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions src/vs/workbench/contrib/chat/browser/chatInputPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -466,6 +466,16 @@ export class ChatInputPart extends Disposable implements IHistoryNavigationWidge
}
}));

this._register(this.chatSessionsService.onDidChangeOptionGroups(chatSessionType => {
const sessionResource = this._widget?.viewModel?.model.sessionResource;
if (sessionResource) {
const ctx = this.chatService.getChatSessionFromInternalUri(sessionResource);
if (ctx?.chatSessionType === chatSessionType) {
this.refreshChatSessionPickers();
}
}
}));

this._attachmentModel = this._register(this.instantiationService.createInstance(ChatAttachmentModel));
this._register(this._attachmentModel.onDidChange(() => this._syncInputStateToModel()));
this.selectedToolsModel = this._register(this.instantiationService.createInstance(ChatSelectedTools, this.currentModeObs));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
public get onDidChangeContentProviderSchemes() { return this._onDidChangeContentProviderSchemes.event; }
private readonly _onDidChangeSessionOptions = this._register(new Emitter<URI>());
public get onDidChangeSessionOptions() { return this._onDidChangeSessionOptions.event; }
private readonly _onDidChangeOptionGroups = this._register(new Emitter<string>());
public get onDidChangeOptionGroups() { return this._onDidChangeOptionGroups.event; }

private readonly inProgressMap: Map<string, number> = new Map();
private readonly _sessionTypeOptions: Map<string, IChatSessionProviderOptionGroup[]> = new Map();
Expand Down Expand Up @@ -1057,6 +1059,7 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
} else {
this._sessionTypeOptions.delete(chatSessionType);
}
this._onDidChangeOptionGroups.fire(chatSessionType);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ export interface IChatSessionsService {
* Get the capabilities for a specific session type
*/
getCapabilitiesForSessionType(chatSessionType: string): IChatAgentAttachmentCapabilities | undefined;
onDidChangeOptionGroups: Event<string>;

getOptionGroupsForSessionType(chatSessionType: string): IChatSessionProviderOptionGroup[] | undefined;
setOptionGroupsForSessionType(chatSessionType: string, handle: number, optionGroups?: IChatSessionProviderOptionGroup[]): void;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ export class MockChatSessionsService implements IChatSessionsService {
private readonly _onDidChangeContentProviderSchemes = new Emitter<{ readonly added: string[]; readonly removed: string[] }>();
readonly onDidChangeContentProviderSchemes = this._onDidChangeContentProviderSchemes.event;

private readonly _onDidChangeOptionGroups = new Emitter<string>();
readonly onDidChangeOptionGroups = this._onDidChangeOptionGroups.event;

private sessionItemProviders = new Map<string, IChatSessionItemProvider>();
private contentProviders = new Map<string, IChatSessionContentProvider>();
private contributions: IChatSessionsExtensionPoint[] = [];
Expand Down
Loading