mirror of
https://github.com/microsoft/vscode.git
synced 2026-02-04 01:44:44 -06:00
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:
parent
c2fdbaa74e
commit
23bc47dbab
@ -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)) {
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -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 {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user