@@ -135,8 +135,8 @@ export class ChatService extends Disposable implements IChatService {
135
135
private readonly _onDidPerformUserAction = this . _register ( new Emitter < IChatUserActionEvent > ( ) ) ;
136
136
public readonly onDidPerformUserAction : Event < IChatUserActionEvent > = this . _onDidPerformUserAction . event ;
137
137
138
- private readonly _onDidCompleteSlashCommand = this . _register ( new Emitter < { slashCommand : string ; sessionId : string } > ( ) ) ;
139
- public readonly onDidCompleteSlashCommand = this . _onDidCompleteSlashCommand . event ;
138
+ private readonly _onDidSubmitSlashCommand = this . _register ( new Emitter < { slashCommand : string ; sessionId : string } > ( ) ) ;
139
+ public readonly onDidSubmitSlashCommand = this . _onDidSubmitSlashCommand . event ;
140
140
141
141
constructor (
142
142
@IStorageService private readonly storageService : IStorageService ,
@@ -446,6 +446,9 @@ export class ChatService extends Disposable implements IChatService {
446
446
447
447
model . cancelRequest ( request ) ;
448
448
} ) ;
449
+ if ( usedSlashCommand ?. command ) {
450
+ this . _onDidSubmitSlashCommand . fire ( { slashCommand : usedSlashCommand . command , sessionId : model . sessionId } ) ;
451
+ }
449
452
let rawResponse = await provider . provideReply ( { session : model . session ! , message : resolvedCommand } , progressCallback , token ) ;
450
453
if ( token . isCancellationRequested ) {
451
454
return ;
@@ -475,15 +478,9 @@ export class ChatService extends Disposable implements IChatService {
475
478
Promise . resolve ( provider . provideFollowups ( model . session ! , CancellationToken . None ) ) . then ( followups => {
476
479
model . setFollowups ( request , withNullAsUndefined ( followups ) ) ;
477
480
model . completeResponse ( request ) ;
478
- if ( usedSlashCommand ?. command ) {
479
- this . _onDidCompleteSlashCommand . fire ( { slashCommand : usedSlashCommand . command , sessionId : model . sessionId } ) ;
480
- }
481
481
} ) ;
482
482
} else {
483
483
model . completeResponse ( request ) ;
484
- if ( usedSlashCommand ?. command ) {
485
- this . _onDidCompleteSlashCommand . fire ( { slashCommand : usedSlashCommand . command , sessionId : model . sessionId } ) ;
486
- }
487
484
}
488
485
}
489
486
} ) ;
0 commit comments