33 * Licensed under the MIT License. See License.txt in the project root for license information.
44 *--------------------------------------------------------------------------------------------*/
55
6+ import { Action } from 'vs/base/common/actions' ;
67import { CancellationToken , CancellationTokenSource } from 'vs/base/common/cancellation' ;
78import { Emitter , Event } from 'vs/base/common/event' ;
89import { MarkdownString } from 'vs/base/common/htmlContent' ;
@@ -12,10 +13,11 @@ import { revive } from 'vs/base/common/marshalling';
1213import { StopWatch } from 'vs/base/common/stopwatch' ;
1314import { URI , UriComponents } from 'vs/base/common/uri' ;
1415import { localize } from 'vs/nls' ;
15- import { CommandsRegistry } from 'vs/platform/commands/common/commands' ;
16+ import { CommandsRegistry , ICommandService } from 'vs/platform/commands/common/commands' ;
1617import { IContextKey , IContextKeyService } from 'vs/platform/contextkey/common/contextkey' ;
1718import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
1819import { ILogService } from 'vs/platform/log/common/log' ;
20+ import { INotificationService , Severity } from 'vs/platform/notification/common/notification' ;
1921import { Progress } from 'vs/platform/progress/common/progress' ;
2022import { IStorageService , StorageScope , StorageTarget } from 'vs/platform/storage/common/storage' ;
2123import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry' ;
@@ -167,7 +169,9 @@ export class ChatService extends Disposable implements IChatService {
167169 @IWorkspaceContextService private readonly workspaceContextService : IWorkspaceContextService ,
168170 @IChatSlashCommandService private readonly chatSlashCommandService : IChatSlashCommandService ,
169171 @IChatVariablesService private readonly chatVariablesService : IChatVariablesService ,
170- @IChatAgentService private readonly chatAgentService : IChatAgentService
172+ @IChatAgentService private readonly chatAgentService : IChatAgentService ,
173+ @INotificationService private readonly notificationService : INotificationService ,
174+ @ICommandService private readonly commandService : ICommandService ,
171175 ) {
172176 super ( ) ;
173177
@@ -396,6 +400,17 @@ export class ChatService extends Disposable implements IChatService {
396400
397401 const defaultAgent = this . chatAgentService . getDefaultAgent ( ) ;
398402 if ( ! defaultAgent ) {
403+ this . notificationService . notify ( {
404+ severity : Severity . Error ,
405+ message : localize ( 'chatFailErrorMessage' , "Chat failed to load. Please ensure that the GitHub Copilot Chat extension is up to date." ) ,
406+ actions : {
407+ primary : [
408+ new Action ( 'showExtension' , localize ( 'action.showExtension' , "Show Extension" ) , undefined , true , ( ) => {
409+ return this . commandService . executeCommand ( 'workbench.extensions.action.showExtensionsWithIds' , [ 'GitHub.copilot-chat' ] ) ;
410+ } )
411+ ]
412+ }
413+ } ) ;
399414 throw new Error ( 'No default agent' ) ;
400415 }
401416
0 commit comments