File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -450,9 +450,13 @@ export abstract class EditorAction2 extends Action2 {
450450 // precondition does hold
451451 return editor . invokeWithinContext ( ( editorAccessor ) => {
452452 const kbService = editorAccessor . get ( IContextKeyService ) ;
453- if ( kbService . contextMatchesRules ( withNullAsUndefined ( this . desc . precondition ) ) ) {
454- return this . runEditorCommand ( editorAccessor , editor ! , ...args ) ;
453+ const logService = editorAccessor . get ( ILogService ) ;
454+ const enabled = kbService . contextMatchesRules ( withNullAsUndefined ( this . desc . precondition ) ) ;
455+ if ( ! enabled ) {
456+ logService . debug ( `[EditorAction2] NOT running command because its precondition is FALSE` , this . desc . id , this . desc . precondition ?. serialize ( ) ) ;
457+ return ;
455458 }
459+ return this . runEditorCommand ( editorAccessor , editor ! , ...args ) ;
456460 } ) ;
457461 }
458462
You can’t perform that action at this time.
0 commit comments