stategically whenInstalledExtensionsRegistered for chatSessions contributions

This commit is contained in:
Josh Spicer 2025-08-01 11:53:08 -07:00
parent 3828c7d252
commit b893c30e4c
2 changed files with 5 additions and 4 deletions

View File

@ -130,6 +130,7 @@ export class ChatEditor extends EditorPane {
if (input.resource.scheme === Schemas.vscodeChatSession) {
const identifier = ChatSessionUri.parse(input.resource);
if (identifier) {
await this.chatSessionsService.canResolveContentProvider(input.resource.authority);
const contributions = this.chatSessionsService.getChatSessionContributions();
const contribution = contributions.find(c => c.type === identifier.chatSessionType);
if (contribution) {

View File

@ -310,6 +310,8 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
}
async canResolveItemProvider(chatViewType: string) {
await this._extensionService.whenInstalledExtensionsRegistered();
// First check if the contribution is available based on its when clause
const contribution = this._contributions.get(chatViewType);
if (contribution && !this._isContributionAvailable(contribution)) {
@ -320,9 +322,7 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
return true;
}
await this._extensionService.whenInstalledExtensionsRegistered();
await this._extensionService.activateByEvent(`onChatSession:${chatViewType}`);
return this._itemsProviders.has(chatViewType);
}
@ -331,6 +331,8 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
}
async canResolveContentProvider(chatViewType: string) {
await this._extensionService.whenInstalledExtensionsRegistered();
// First check if the contribution is available based on its when clause
const contribution = this._contributions.get(chatViewType);
if (contribution && !this._isContributionAvailable(contribution)) {
@ -341,9 +343,7 @@ export class ChatSessionsService extends Disposable implements IChatSessionsServ
return true;
}
await this._extensionService.whenInstalledExtensionsRegistered();
await this._extensionService.activateByEvent(`onChatSession:${chatViewType}`);
return this._contentProviders.has(chatViewType);
}