mirror of
https://github.com/Microsoft/vscode
synced 2024-09-13 21:55:38 +00:00
voice - disable start action when request is active in terminal (#208801)
This commit is contained in:
parent
1a2cc56282
commit
a375ea8754
|
@ -52,7 +52,7 @@ import { ThemeIcon } from 'vs/base/common/themables';
|
||||||
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
|
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
|
||||||
import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal';
|
import { ITerminalService } from 'vs/workbench/contrib/terminal/browser/terminal';
|
||||||
import { ProgressLocation } from 'vs/platform/progress/common/progress';
|
import { ProgressLocation } from 'vs/platform/progress/common/progress';
|
||||||
import { TerminalChatController } from 'vs/workbench/contrib/terminal/browser/terminalContribExports';
|
import { TerminalChatController, TerminalChatContextKeys } from 'vs/workbench/contrib/terminal/browser/terminalContribExports';
|
||||||
|
|
||||||
const CONTEXT_VOICE_CHAT_GETTING_READY = new RawContextKey<boolean>('voiceChatGettingReady', false, { type: 'boolean', description: localize('voiceChatGettingReady', "True when getting ready for receiving voice input from the microphone for voice chat.") });
|
const CONTEXT_VOICE_CHAT_GETTING_READY = new RawContextKey<boolean>('voiceChatGettingReady', false, { type: 'boolean', description: localize('voiceChatGettingReady', "True when getting ready for receiving voice input from the microphone for voice chat.") });
|
||||||
const CONTEXT_VOICE_CHAT_IN_PROGRESS = new RawContextKey<boolean>('voiceChatInProgress', false, { type: 'boolean', description: localize('voiceChatInProgress', "True when voice recording from microphone is in progress for voice chat.") });
|
const CONTEXT_VOICE_CHAT_IN_PROGRESS = new RawContextKey<boolean>('voiceChatInProgress', false, { type: 'boolean', description: localize('voiceChatInProgress', "True when voice recording from microphone is in progress for voice chat.") });
|
||||||
|
@ -616,7 +616,7 @@ export class StartVoiceChatAction extends Action2 {
|
||||||
primary: KeyMod.CtrlCmd | KeyCode.KeyI
|
primary: KeyMod.CtrlCmd | KeyCode.KeyI
|
||||||
},
|
},
|
||||||
icon: Codicon.mic,
|
icon: Codicon.mic,
|
||||||
precondition: ContextKeyExpr.and(CanVoiceChat, CONTEXT_VOICE_CHAT_GETTING_READY.negate(), CONTEXT_CHAT_REQUEST_IN_PROGRESS.negate(), CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST.negate()),
|
precondition: ContextKeyExpr.and(CanVoiceChat, CONTEXT_VOICE_CHAT_GETTING_READY.negate(), CONTEXT_CHAT_REQUEST_IN_PROGRESS.negate(), CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST.negate(), TerminalChatContextKeys.requestActive.negate()),
|
||||||
menu: [{
|
menu: [{
|
||||||
id: MenuId.ChatExecute,
|
id: MenuId.ChatExecute,
|
||||||
when: ContextKeyExpr.and(HasSpeechProvider, CONTEXT_VOICE_CHAT_IN_VIEW_IN_PROGRESS.negate(), CONTEXT_QUICK_VOICE_CHAT_IN_PROGRESS.negate(), CONTEXT_VOICE_CHAT_IN_EDITOR_IN_PROGRESS.negate()),
|
when: ContextKeyExpr.and(HasSpeechProvider, CONTEXT_VOICE_CHAT_IN_VIEW_IN_PROGRESS.negate(), CONTEXT_QUICK_VOICE_CHAT_IN_PROGRESS.negate(), CONTEXT_VOICE_CHAT_IN_EDITOR_IN_PROGRESS.negate()),
|
||||||
|
|
|
@ -7,3 +7,5 @@
|
||||||
// to touch terminalContrib either.
|
// to touch terminalContrib either.
|
||||||
// eslint-disable-next-line local/code-import-patterns
|
// eslint-disable-next-line local/code-import-patterns
|
||||||
export { TerminalChatController } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController';
|
export { TerminalChatController } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChatController';
|
||||||
|
// eslint-disable-next-line local/code-import-patterns
|
||||||
|
export { TerminalChatContextKeys } from 'vs/workbench/contrib/terminalContrib/chat/browser/terminalChat';
|
||||||
|
|
Loading…
Reference in a new issue