@@ -12,7 +12,7 @@ import { EditorContextKeys } from 'vs/editor/common/editorContextKeys';
1212import { InlineChatController , InlineChatRunOptions } from 'vs/workbench/contrib/inlineChat/browser/inlineChatController' ;
1313import { CTX_INLINE_CHAT_FOCUSED , CTX_INLINE_CHAT_HAS_ACTIVE_REQUEST , CTX_INLINE_CHAT_HAS_PROVIDER , CTX_INLINE_CHAT_INNER_CURSOR_FIRST , CTX_INLINE_CHAT_INNER_CURSOR_LAST , CTX_INLINE_CHAT_EMPTY , CTX_INLINE_CHAT_OUTER_CURSOR_POSITION , CTX_INLINE_CHAT_VISIBLE , MENU_INLINE_CHAT_WIDGET , MENU_INLINE_CHAT_WIDGET_DISCARD , MENU_INLINE_CHAT_WIDGET_STATUS , CTX_INLINE_CHAT_LAST_FEEDBACK , CTX_INLINE_CHAT_SHOWING_DIFF , CTX_INLINE_CHAT_EDIT_MODE , EditMode , CTX_INLINE_CHAT_LAST_RESPONSE_TYPE , MENU_INLINE_CHAT_WIDGET_MARKDOWN_MESSAGE , CTX_INLINE_CHAT_MESSAGE_CROP_STATE , CTX_INLINE_CHAT_DOCUMENT_CHANGED , CTX_INLINE_CHAT_DID_EDIT , CTX_INLINE_CHAT_HAS_STASHED_SESSION , MENU_INLINE_CHAT_WIDGET_FEEDBACK , ACTION_ACCEPT_CHANGES , ACTION_REGENERATE_RESPONSE , InlineChatResponseType , CTX_INLINE_CHAT_RESPONSE_TYPES , InlineChateResponseTypes , ACTION_VIEW_IN_CHAT , CTX_INLINE_CHAT_USER_DID_EDIT , MENU_INLINE_CHAT_WIDGET_TOGGLE } from 'vs/workbench/contrib/inlineChat/common/inlineChat' ;
1414import { localize } from 'vs/nls' ;
15- import { IAction2Options , MenuRegistry } from 'vs/platform/actions/common/actions' ;
15+ import { IAction2Options , MenuId , MenuRegistry } from 'vs/platform/actions/common/actions' ;
1616import { IClipboardService } from 'vs/platform/clipboard/common/clipboardService' ;
1717import { ContextKeyExpr } from 'vs/platform/contextkey/common/contextkey' ;
1818import { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
@@ -452,25 +452,29 @@ export class ToggleInlineDiff extends AbstractInlineChatAction {
452452 constructor ( ) {
453453 super ( {
454454 id : 'inlineChat.toggleDiff' ,
455- title : localize ( 'toggleDiff' , 'Toggle Diff' ) ,
456- icon : Codicon . diff ,
457- precondition : ContextKeyExpr . and ( CTX_INLINE_CHAT_VISIBLE ) ,
455+ title : {
456+ value : localize ( 'toggleDiff' , 'Toggle Diff' ) ,
457+ mnemonicTitle : localize ( { key : 'miToggleDiff' , comment : [ '&& denotes a mnemonic' ] } , "&&Toggle Diff" ) ,
458+ original : 'Toggle Diff' ,
459+ } ,
458460 category : Categories . View ,
459461 toggled : {
460- condition : CTX_INLINE_CHAT_SHOWING_DIFF ,
461- title : localize ( 'toggleDiff2' , "Show Inline Diff" )
462+ condition : ContextKeyExpr . equals ( 'config.inlineChat.showDiff' , true ) ,
463+ title : localize ( 'toggleDiff2' , "Toggle Diff" ) ,
464+ mnemonicTitle : localize ( { key : 'miToggleDiff2' , comment : [ '&& denotes a mnemonic' ] } , "&&Toggle Diff" )
462465 } ,
463- menu : {
464- id : MENU_INLINE_CHAT_WIDGET_TOGGLE ,
465- when : CTX_INLINE_CHAT_EDIT_MODE . notEqualsTo ( EditMode . Preview )
466- }
466+ menu : [
467+ { id : MenuId . CommandPalette } ,
468+ { id : MENU_INLINE_CHAT_WIDGET_TOGGLE }
469+ ]
467470 } ) ;
468471 }
469472
470473 override runInlineChatCommand ( accessor : ServicesAccessor , _ctrl : InlineChatController ) : void {
471474 const configurationService = accessor . get ( IConfigurationService ) ;
472475 const newValue = ! configurationService . getValue ( 'inlineChat.showDiff' ) ;
473476 configurationService . updateValue ( 'inlineChat.showDiff' , newValue ) ;
477+ console . log ( 'newValue : ' , newValue ) ;
474478 }
475479}
476480
0 commit comments