Skip to content

Commit

Permalink
Ctrl + I does not work when chat input field has focus (fix #213637) (
Browse files Browse the repository at this point in the history
#213776)

* `Ctrl + I` does not work when chat input field has focus (fix #213637)

* simplify
  • Loading branch information
bpasero authored May 29, 2024
1 parent 4445673 commit 8ed0323
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions src/vs/workbench/contrib/chat/common/voiceChatService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,8 @@ export class VoiceChatService extends Disposable implements IVoiceChatService {
disposables.add(session.onDidChange(e => {
switch (e.status) {
case SpeechToTextStatus.Recognizing:
case SpeechToTextStatus.Recognized:
case SpeechToTextStatus.Recognized: {
let massagedEvent: IVoiceChatTextEvent = e;
if (e.text) {
const startsWithAgent = e.text.startsWith(VoiceChatService.PHRASES_UPPER[VoiceChatService.AGENT_PREFIX]) || e.text.startsWith(VoiceChatService.PHRASES_LOWER[VoiceChatService.AGENT_PREFIX]);
const startsWithSlashCommand = e.text.startsWith(VoiceChatService.PHRASES_UPPER[VoiceChatService.COMMAND_PREFIX]) || e.text.startsWith(VoiceChatService.PHRASES_LOWER[VoiceChatService.COMMAND_PREFIX]);
Expand Down Expand Up @@ -208,15 +209,16 @@ export class VoiceChatService extends Disposable implements IVoiceChatService {
}
}

emitter.fire({
massagedEvent = {
status: e.status,
text: (transformedWords ?? originalWords).join(' '),
waitingForInput
});

break;
};
}
}
emitter.fire(massagedEvent);
break;
}
case SpeechToTextStatus.Started:
this.activeVoiceChatSessions++;
this.voiceChatInProgress.set(true);
Expand All @@ -226,7 +228,7 @@ export class VoiceChatService extends Disposable implements IVoiceChatService {
onSessionStoppedOrCanceled(false);
emitter.fire(e);
break;
default:
case SpeechToTextStatus.Error:
emitter.fire(e);
break;
}
Expand Down

0 comments on commit 8ed0323

Please sign in to comment.