@@ -16,12 +16,10 @@ import { IEditorContribution } from 'vs/editor/common/editorCommon';
16
16
import { EditorContextKeys } from 'vs/editor/common/editorContextKeys' ;
17
17
import { CodeActionTriggerType } from 'vs/editor/common/languages' ;
18
18
import { ILanguageFeaturesService } from 'vs/editor/common/services/languageFeatures' ;
19
- import { acceptSelectedCodeActionCommand , applyCodeAction , ApplyCodeActionReason , codeActionCommandId , fixAllCommandId , organizeImportsCommandId , previewSelectedCodeActionCommand , refactorCommandId , refactorPreviewCommandId , sourceActionCommandId } from 'vs/editor/contrib/codeAction/browser/codeAction' ;
19
+ import { applyCodeAction , ApplyCodeActionReason , codeActionCommandId , fixAllCommandId , organizeImportsCommandId , refactorCommandId , refactorPreviewCommandId , sourceActionCommandId } from 'vs/editor/contrib/codeAction/browser/codeAction' ;
20
20
import { CodeActionUi } from 'vs/editor/contrib/codeAction/browser/codeActionUi' ;
21
- import { CodeActionWidget , Context } from 'vs/editor/contrib/codeAction/browser/codeActionWidget' ;
22
21
import { MessageController } from 'vs/editor/contrib/message/browser/messageController' ;
23
22
import * as nls from 'vs/nls' ;
24
- import { Action2 , registerAction2 } from 'vs/platform/actions/common/actions' ;
25
23
import { ContextKeyExpr , IContextKeyService } from 'vs/platform/contextkey/common/contextkey' ;
26
24
import { IInstantiationService } from 'vs/platform/instantiation/common/instantiation' ;
27
25
import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry' ;
@@ -102,7 +100,7 @@ export class CodeActionController extends Disposable implements IEditorContribut
102
100
@IContextKeyService contextKeyService : IContextKeyService ,
103
101
@IEditorProgressService progressService : IEditorProgressService ,
104
102
@IInstantiationService private readonly _instantiationService : IInstantiationService ,
105
- @ILanguageFeaturesService languageFeaturesService : ILanguageFeaturesService ,
103
+ @ILanguageFeaturesService languageFeaturesService : ILanguageFeaturesService
106
104
) {
107
105
super ( ) ;
108
106
@@ -416,117 +414,3 @@ export class AutoFixAction extends EditorAction {
416
414
CodeActionAutoApply . IfSingle , undefined , CodeActionTriggerSource . AutoFix ) ;
417
415
}
418
416
}
419
-
420
- const weight = KeybindingWeight . EditorContrib + 1000 ;
421
-
422
- registerAction2 ( class extends Action2 {
423
- constructor ( ) {
424
- super ( {
425
- id : 'hideCodeActionWidget' ,
426
- title : {
427
- value : nls . localize ( 'hideCodeActionWidget.title' , "Hide code action widget" ) ,
428
- original : 'Hide code action widget'
429
- } ,
430
- precondition : Context . Visible ,
431
- keybinding : {
432
- weight,
433
- primary : KeyCode . Escape ,
434
- secondary : [ KeyMod . Shift | KeyCode . Escape ]
435
- } ,
436
- } ) ;
437
- }
438
-
439
- run ( ) : void {
440
- CodeActionWidget . INSTANCE ?. hide ( ) ;
441
- }
442
- } ) ;
443
-
444
- registerAction2 ( class extends Action2 {
445
- constructor ( ) {
446
- super ( {
447
- id : 'selectPrevCodeAction' ,
448
- title : {
449
- value : nls . localize ( 'selectPrevCodeAction.title' , "Select previous code action" ) ,
450
- original : 'Select previous code action'
451
- } ,
452
- precondition : Context . Visible ,
453
- keybinding : {
454
- weight,
455
- primary : KeyCode . UpArrow ,
456
- secondary : [ KeyMod . CtrlCmd | KeyCode . UpArrow ] ,
457
- mac : { primary : KeyCode . UpArrow , secondary : [ KeyMod . CtrlCmd | KeyCode . UpArrow , KeyMod . WinCtrl | KeyCode . KeyP ] } ,
458
- }
459
- } ) ;
460
- }
461
-
462
- run ( ) : void {
463
- CodeActionWidget . INSTANCE ?. focusPrevious ( ) ;
464
- }
465
- } ) ;
466
-
467
- registerAction2 ( class extends Action2 {
468
- constructor ( ) {
469
- super ( {
470
- id : 'selectNextCodeAction' ,
471
- title : {
472
- value : nls . localize ( 'selectNextCodeAction.title' , "Select next code action" ) ,
473
- original : 'Select next code action'
474
- } ,
475
- precondition : Context . Visible ,
476
- keybinding : {
477
- weight,
478
- primary : KeyCode . DownArrow ,
479
- secondary : [ KeyMod . CtrlCmd | KeyCode . DownArrow ] ,
480
- mac : { primary : KeyCode . DownArrow , secondary : [ KeyMod . CtrlCmd | KeyCode . DownArrow , KeyMod . WinCtrl | KeyCode . KeyN ] }
481
- }
482
- } ) ;
483
- }
484
-
485
- run ( ) : void {
486
- CodeActionWidget . INSTANCE ?. focusNext ( ) ;
487
- }
488
- } ) ;
489
-
490
- registerAction2 ( class extends Action2 {
491
- constructor ( ) {
492
- super ( {
493
- id : acceptSelectedCodeActionCommand ,
494
- title : {
495
- value : nls . localize ( 'acceptSelected.title' , "Accept selected code action" ) ,
496
- original : 'Accept selected code action'
497
- } ,
498
- precondition : Context . Visible ,
499
- keybinding : {
500
- weight,
501
- primary : KeyCode . Enter ,
502
- secondary : [ KeyMod . CtrlCmd | KeyCode . Period ] ,
503
- }
504
- } ) ;
505
- }
506
-
507
- run ( ) : void {
508
- CodeActionWidget . INSTANCE ?. acceptSelected ( ) ;
509
- }
510
- } ) ;
511
-
512
- registerAction2 ( class extends Action2 {
513
- constructor ( ) {
514
- super ( {
515
- id : previewSelectedCodeActionCommand ,
516
- title : {
517
- value : nls . localize ( 'previewSelected.title' , "Preview selected code action" ) ,
518
- original : 'Preview selected code action'
519
- } ,
520
- precondition : Context . Visible ,
521
- keybinding : {
522
- weight,
523
- primary : KeyMod . CtrlCmd | KeyCode . Enter ,
524
- }
525
- } ) ;
526
- }
527
-
528
- run ( ) : void {
529
- CodeActionWidget . INSTANCE ?. acceptSelected ( { preview : true } ) ;
530
- }
531
- } ) ;
532
-
0 commit comments