@@ -23,7 +23,7 @@ import { KeyMod, KeyCode } from 'vs/base/common/keyCodes';
2323import { WorkbenchListFocusContextKey } from 'vs/platform/list/browser/listService' ;
2424import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors' ;
2525import { URI } from 'vs/base/common/uri' ;
26- import { MenuId , registerAction2 , IAction2 } from 'vs/platform/actions/common/actions' ;
26+ import { MenuId , registerAction2 , Action2 } from 'vs/platform/actions/common/actions' ;
2727import { IEditorInput } from 'vs/workbench/common/editor' ;
2828import type { ServicesAccessor } from 'vs/platform/instantiation/common/instantiation' ;
2929
@@ -112,28 +112,30 @@ class BulkEditPreviewContribution {
112112
113113
114114// CMD: accept
115- registerAction2 ( new class ApplyAction implements IAction2 {
116-
117- readonly desc = {
118- id : 'refactorPreview.apply' ,
119- title : { value : localize ( 'apply' , "Apply Refactoring" ) , original : 'Apply Refactoring' } ,
120- category : localize ( 'cat' , "Refactor Preview" ) ,
121- icon : { id : 'codicon/check' } ,
122- precondition : BulkEditPreviewContribution . ctxEnabled ,
123- menu : [ {
124- id : MenuId . ViewTitle ,
125- when : ContextKeyExpr . equals ( 'view' , BulkEditPane . ID ) ,
126- group : 'navigation'
127- } , {
128- id : MenuId . BulkEditPaneContext ,
129- order : 1
130- } ] ,
131- keybinding : {
132- weight : KeybindingWeight . WorkbenchContrib ,
133- when : BulkEditPreviewContribution . ctxEnabled ,
134- primary : KeyMod . Shift + KeyCode . Enter ,
135- }
136- } ;
115+ registerAction2 ( class ApplyAction extends Action2 {
116+
117+ constructor ( ) {
118+ super ( {
119+ id : 'refactorPreview.apply' ,
120+ title : { value : localize ( 'apply' , "Apply Refactoring" ) , original : 'Apply Refactoring' } ,
121+ category : localize ( 'cat' , "Refactor Preview" ) ,
122+ icon : { id : 'codicon/check' } ,
123+ precondition : BulkEditPreviewContribution . ctxEnabled ,
124+ menu : [ {
125+ id : MenuId . ViewTitle ,
126+ when : ContextKeyExpr . equals ( 'view' , BulkEditPane . ID ) ,
127+ group : 'navigation'
128+ } , {
129+ id : MenuId . BulkEditPaneContext ,
130+ order : 1
131+ } ] ,
132+ keybinding : {
133+ weight : KeybindingWeight . WorkbenchContrib ,
134+ when : BulkEditPreviewContribution . ctxEnabled ,
135+ primary : KeyMod . Shift + KeyCode . Enter ,
136+ }
137+ } ) ;
138+ }
137139
138140 run ( accessor : ServicesAccessor ) : any {
139141 const panelService = accessor . get ( IPanelService ) ;
@@ -145,23 +147,25 @@ registerAction2(new class ApplyAction implements IAction2 {
145147} ) ;
146148
147149// CMD: discard
148- registerAction2 ( new class DiscardAction implements IAction2 {
149-
150- readonly desc = {
151- id : 'refactorPreview.discard' ,
152- title : { value : localize ( 'Discard' , "Discard Refactoring" ) , original : 'Discard Refactoring' } ,
153- category : localize ( 'cat' , "Refactor Preview" ) ,
154- icon : { id : 'codicon/clear-all' } ,
155- precondition : BulkEditPreviewContribution . ctxEnabled ,
156- menu : [ {
157- id : MenuId . ViewTitle ,
158- when : ContextKeyExpr . equals ( 'view' , BulkEditPane . ID ) ,
159- group : 'navigation'
160- } , {
161- id : MenuId . BulkEditPaneContext ,
162- order : 2
163- } ]
164- } ;
150+ registerAction2 ( class DiscardAction extends Action2 {
151+
152+ constructor ( ) {
153+ super ( {
154+ id : 'refactorPreview.discard' ,
155+ title : { value : localize ( 'Discard' , "Discard Refactoring" ) , original : 'Discard Refactoring' } ,
156+ category : localize ( 'cat' , "Refactor Preview" ) ,
157+ icon : { id : 'codicon/clear-all' } ,
158+ precondition : BulkEditPreviewContribution . ctxEnabled ,
159+ menu : [ {
160+ id : MenuId . ViewTitle ,
161+ when : ContextKeyExpr . equals ( 'view' , BulkEditPane . ID ) ,
162+ group : 'navigation'
163+ } , {
164+ id : MenuId . BulkEditPaneContext ,
165+ order : 2
166+ } ]
167+ } ) ;
168+ }
165169
166170 run ( accessor : ServicesAccessor ) : void | Promise < void > {
167171 const panelService = accessor . get ( IPanelService ) ;
@@ -174,24 +178,26 @@ registerAction2(new class DiscardAction implements IAction2 {
174178
175179
176180// CMD: toggle
177- registerAction2 ( new class ToggleAction implements IAction2 {
178-
179- readonly desc = {
180- id : 'refactorPreview.toggleCheckedState' ,
181- title : { value : localize ( 'toogleSelection' , "Accept Change" ) , original : 'Accept Change' } ,
182- category : localize ( 'cat' , "Refactor Preview" ) ,
183- precondition : BulkEditPreviewContribution . ctxEnabled ,
184- toggled : BulkEditPane . ctxChangeChecked ,
185- keybinding : {
186- weight : KeybindingWeight . WorkbenchContrib ,
187- when : WorkbenchListFocusContextKey ,
188- primary : KeyCode . Space ,
189- } ,
190- menu : {
191- id : MenuId . BulkEditPaneContext ,
192- group : 'navigation'
193- }
194- } ;
181+ registerAction2 ( class ToggleAction extends Action2 {
182+
183+ constructor ( ) {
184+ super ( {
185+ id : 'refactorPreview.toggleCheckedState' ,
186+ title : { value : localize ( 'toogleSelection' , "Accept Change" ) , original : 'Accept Change' } ,
187+ category : localize ( 'cat' , "Refactor Preview" ) ,
188+ precondition : BulkEditPreviewContribution . ctxEnabled ,
189+ toggled : BulkEditPane . ctxChangeChecked ,
190+ keybinding : {
191+ weight : KeybindingWeight . WorkbenchContrib ,
192+ when : WorkbenchListFocusContextKey ,
193+ primary : KeyCode . Space ,
194+ } ,
195+ menu : {
196+ id : MenuId . BulkEditPaneContext ,
197+ group : 'navigation'
198+ }
199+ } ) ;
200+ }
195201
196202 run ( accessor : ServicesAccessor ) : void | Promise < void > {
197203 const panelService = accessor . get ( IPanelService ) ;
0 commit comments