Skip to content

Commit 43addb7

Browse files
authored
Tweak text in chat failure view (microsoft#227231)
1 parent 336db9e commit 43addb7

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

src/vs/workbench/contrib/chat/browser/chatParticipantContributions.ts

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { ExtensionIdentifier } from 'vs/platform/extensions/common/extensions';
1313
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
1414
import { ILogService } from 'vs/platform/log/common/log';
1515
import { Severity } from 'vs/platform/notification/common/notification';
16+
import { IProductService } from 'vs/platform/product/common/productService';
1617
import { Registry } from 'vs/platform/registry/common/platform';
1718
import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneContainer';
1819
import { IWorkbenchContribution } from 'vs/workbench/common/contributions';
@@ -320,21 +321,24 @@ export class ChatCompatibilityNotifier implements IWorkbenchContribution {
320321
@IExtensionsWorkbenchService extensionsWorkbenchService: IExtensionsWorkbenchService,
321322
@IContextKeyService contextKeyService: IContextKeyService,
322323
@IChatAgentService chatAgentService: IChatAgentService,
324+
@IProductService productService: IProductService,
323325
) {
324326
// It may be better to have some generic UI for this, for any extension that is incompatible,
325327
// but this is only enabled for Copilot Chat now and it needs to be obvious.
326-
327-
const showExtensionLabel = localize('showExtension', "Show Extension");
328-
const viewsRegistry = Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry);
329-
viewsRegistry.registerViewWelcomeContent(CHAT_VIEW_ID, {
330-
content: localize('chatFailErrorMessage', "Chat failed to load. Please ensure that the GitHub Copilot Chat extension is up to date.") + `\n\n[${showExtensionLabel}](command:${showExtensionsWithIdsCommandId}?${encodeURIComponent(JSON.stringify([['GitHub.copilot-chat']]))})`,
331-
when: CONTEXT_CHAT_EXTENSION_INVALID,
332-
});
333-
334328
const isInvalid = CONTEXT_CHAT_EXTENSION_INVALID.bindTo(contextKeyService);
335329
extensionsWorkbenchService.queryLocal().then(exts => {
336330
const chat = exts.find(ext => ext.identifier.id === 'github.copilot-chat');
337331
if (chat?.local?.validations.some(v => v[0] === Severity.Error)) {
332+
const showExtensionLabel = localize('showExtension', "Show Extension");
333+
const mainMessage = localize('chatFailErrorMessage', "Chat failed to load because the installed version of the {0} extension is not compatible with this version of {1}. Please ensure that the GitHub Copilot Chat extension is up to date.", 'GitHub Copilot Chat', productService.nameLong);
334+
const commandButton = `[${showExtensionLabel}](command:${showExtensionsWithIdsCommandId}?${encodeURIComponent(JSON.stringify([['GitHub.copilot-chat']]))})`;
335+
const versionMessage = `GitHub Copilot Chat version: ${chat.version}`;
336+
const viewsRegistry = Registry.as<IViewsRegistry>(ViewExtensions.ViewsRegistry);
337+
viewsRegistry.registerViewWelcomeContent(CHAT_VIEW_ID, {
338+
content: [mainMessage, commandButton, versionMessage].join('\n\n'),
339+
when: CONTEXT_CHAT_EXTENSION_INVALID,
340+
});
341+
338342
// This catches vscode starting up with the invalid extension, but the extension may still get updated by vscode after this.
339343
isInvalid.set(true);
340344
}

0 commit comments

Comments
 (0)