55
66import { IAction } from '../../../../../base/common/actions.js' ;
77import { localize , localize2 } from '../../../../../nls.js' ;
8+ import { MenuId } from '../../../../../platform/actions/common/actions.js' ;
89import { ICommandService } from '../../../../../platform/commands/common/commands.js' ;
910import { ContextKeyExpr , IContextKeyService } from '../../../../../platform/contextkey/common/contextkey.js' ;
1011import { IExtensionManagementService } from '../../../../../platform/extensionManagement/common/extensionManagement.js' ;
@@ -13,7 +14,7 @@ import { INotificationService, Severity } from '../../../../../platform/notifica
1314import { EnablementState , IWorkbenchExtensionEnablementService } from '../../../../services/extensionManagement/common/extensionManagement.js' ;
1415import { HasSpeechProvider , SpeechToTextInProgress } from '../../../speech/common/speechService.js' ;
1516import { registerActiveInstanceAction , sharedWhenClause } from '../../../terminal/browser/terminalActions.js' ;
16- import { TerminalCommandId } from '../../../terminal/common/terminal.js' ;
17+ import { TERMINAL_VIEW_ID , TerminalCommandId } from '../../../terminal/common/terminal.js' ;
1718import { TerminalContextKeys } from '../../../terminal/common/terminalContextKey.js' ;
1819import { TerminalVoiceSession } from './terminalVoice.js' ;
1920
@@ -73,7 +74,15 @@ export function registerTerminalVoiceActions() {
7374 } , learnMoreAction ) ;
7475 }
7576 notificationService . notify ( { severity : Severity . Info , message, actions : { primary : actions } } ) ;
76- }
77+ } ,
78+ menu : [
79+ {
80+ id : MenuId . ViewTitle ,
81+ group : 'voice' ,
82+ when : ContextKeyExpr . and ( ContextKeyExpr . equals ( 'view' , TERMINAL_VIEW_ID ) , TerminalContextKeys . terminalDictationInProgress . toNegated ( ) ) ,
83+ isHiddenByDefault : true
84+ } ,
85+ ]
7786 } ) ;
7887
7988 registerActiveInstanceAction ( {
@@ -84,6 +93,14 @@ export function registerTerminalVoiceActions() {
8493 run : ( activeInstance , c , accessor ) => {
8594 const instantiationService = accessor . get ( IInstantiationService ) ;
8695 TerminalVoiceSession . getInstance ( instantiationService ) . stop ( true ) ;
87- }
96+ } ,
97+ menu : [
98+ {
99+ id : MenuId . ViewTitle ,
100+ group : 'voice' ,
101+ when : ContextKeyExpr . and ( ContextKeyExpr . equals ( 'view' , TERMINAL_VIEW_ID ) , TerminalContextKeys . terminalDictationInProgress ) ,
102+ isHiddenByDefault : true
103+ } ,
104+ ]
88105 } ) ;
89106}
0 commit comments