Don't return providers in IChatSessionsService

Further trying to clean up interface so that `IChatSessionsService` consumers don't know about providers directly
This commit is contained in:
Matt Bierner 2026-02-03 11:28:59 -08:00
parent c2fdbaa74e
commit 23bc47dbab
No known key found for this signature in database
GPG Key ID: 87BD15F7203A4CF2
3 changed files with 9 additions and 5 deletions

View File

@ -730,7 +730,11 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
return this._isContributionAvailable(contribution) ? contribution : undefined;
}
async activateChatSessionItemProvider(chatViewType: string): Promise<IChatSessionItemProvider | undefined> {
async activateChatSessionItemProvider(chatViewType: string): Promise<void> {
await this.doActivateChatSessionItemProvider(chatViewType);
}
private async doActivateChatSessionItemProvider(chatViewType: string): Promise<IChatSessionItemProvider | undefined> {
await this._extensionService.whenInstalledExtensionsRegistered();
const resolvedType = this._resolveToPrimaryType(chatViewType);
if (resolvedType) {
@ -777,7 +781,7 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
continue; // skip: not considered for resolving
}
const provider = await this.activateChatSessionItemProvider(contrib.type);
const provider = await this.doActivateChatSessionItemProvider(contrib.type);
if (!provider) {
// We requested this provider but it is not available
if (providersToResolve?.includes(contrib.type)) {

View File

@ -215,7 +215,7 @@ export interface IChatSessionsService {
getChatSessionContribution(chatSessionType: string): IChatSessionsExtensionPoint | undefined;
registerChatSessionItemProvider(provider: IChatSessionItemProvider): IDisposable;
activateChatSessionItemProvider(chatSessionType: string): Promise<IChatSessionItemProvider | undefined>;
activateChatSessionItemProvider(chatSessionType: string): Promise<void>;
getAllChatSessionContributions(): IChatSessionsExtensionPoint[];
getIconForSessionType(chatSessionType: string): ThemeIcon | URI | undefined;

View File

@ -86,8 +86,8 @@ export class MockChatSessionsService implements IChatSessionsService {
this.contributions = contributions;
}
async activateChatSessionItemProvider(chatSessionType: string): Promise<IChatSessionItemProvider | undefined> {
return this.sessionItemProviders.get(chatSessionType);
async activateChatSessionItemProvider(chatSessionType: string): Promise<void> {
// Noop, nothing to activate
}
getIconForSessionType(chatSessionType: string): ThemeIcon | URI | undefined {