@@ -34,9 +34,10 @@ registerAction2(ToggleCollapseUnchangedRegions);
34
34
MenuRegistry . appendMenuItem ( MenuId . EditorTitle , {
35
35
command : {
36
36
id : new ToggleCollapseUnchangedRegions ( ) . desc . id ,
37
- title : localize ( 'collapseUnchangedRegions' , "Collapse Unchanged Regions" ) ,
37
+ title : localize ( 'collapseUnchangedRegions' , "Show Unchanged Regions" ) ,
38
38
icon : Codicon . map
39
39
} ,
40
+ order : 22 ,
40
41
group : 'navigation' ,
41
42
when : ContextKeyExpr . and (
42
43
ContextKeyExpr . has ( 'config.diffEditor.experimental.collapseUnchangedRegions' ) ,
@@ -47,12 +48,43 @@ MenuRegistry.appendMenuItem(MenuId.EditorTitle, {
47
48
MenuRegistry . appendMenuItem ( MenuId . EditorTitle , {
48
49
command : {
49
50
id : new ToggleCollapseUnchangedRegions ( ) . desc . id ,
50
- title : localize ( 'showUnchangedRegions' , "Show Unchanged Regions" ) ,
51
+ title : localize ( 'showUnchangedRegions' , "Collapse Unchanged Regions" ) ,
51
52
icon : ThemeIcon . modify ( Codicon . map , 'disabled' ) ,
52
53
} ,
54
+ order : 22 ,
53
55
group : 'navigation' ,
54
56
when : ContextKeyExpr . and (
55
57
ContextKeyExpr . has ( 'config.diffEditor.experimental.collapseUnchangedRegions' ) . negate ( ) ,
56
58
ContextKeyEqualsExpr . create ( 'diffEditorVersion' , 2 )
57
59
)
58
60
} ) ;
61
+
62
+ export class ToggleShowMovedCodeBlocks extends Action2 {
63
+ constructor ( ) {
64
+ super ( {
65
+ id : 'diffEditor.toggleShowMovedCodeBlocks' ,
66
+ title : { value : localize ( 'toggleShowMovedCodeBlocks' , "Toggle Show Moved Code Blocks" ) , original : 'Toggle Show Moved Code Blocks' } ,
67
+ precondition : ContextKeyEqualsExpr . create ( 'diffEditorVersion' , 2 ) ,
68
+ } ) ;
69
+ }
70
+
71
+ run ( accessor : ServicesAccessor , ...args : unknown [ ] ) : void {
72
+ const configurationService = accessor . get ( IConfigurationService ) ;
73
+ const newValue = ! configurationService . getValue < boolean > ( 'diffEditor.experimental.showMoves' ) ;
74
+ configurationService . updateValue ( 'diffEditor.experimental.showMoves' , newValue ) ;
75
+ }
76
+ }
77
+
78
+ registerAction2 ( ToggleShowMovedCodeBlocks ) ;
79
+
80
+ MenuRegistry . appendMenuItem ( MenuId . EditorTitle , {
81
+ command : {
82
+ id : new ToggleShowMovedCodeBlocks ( ) . desc . id ,
83
+ title : localize ( 'showMoves' , "Show Moves" ) ,
84
+ icon : Codicon . move ,
85
+ toggled : ContextKeyEqualsExpr . create ( 'config.diffEditor.experimental.showMoves' , true ) ,
86
+ } ,
87
+ order : 10 ,
88
+ group : '1_diff' ,
89
+ when : ContextKeyEqualsExpr . create ( 'diffEditorVersion' , 2 )
90
+ } ) ;
0 commit comments