@@ -146,12 +146,12 @@ public List<Either<Command, CodeAction>> getSourceActionCommands(CodeActionParam
146
146
// Generate QuickAssist
147
147
if (isInImportDeclaration ) {
148
148
Optional <Either <Command , CodeAction >> sourceOrganizeImports = getCodeActionFromProposal (params .getContext (), context .getCompilationUnit (), CorrectionMessages .ReorgCorrectionsSubProcessor_organizeimports_description ,
149
- JavaCodeActionKind .QUICK_ASSIST , organizeImportsProposal , QuickAssistComparator .ORGANIZE_IMPORTS_PRIORITY );
149
+ JavaCodeActionKind .QUICK_ASSIST , organizeImportsProposal , CodeActionComparator .ORGANIZE_IMPORTS_PRIORITY );
150
150
addSourceActionCommand ($ , params .getContext (), sourceOrganizeImports );
151
151
}
152
152
// Generate Source Action
153
153
Optional <Either <Command , CodeAction >> sourceOrganizeImports = getCodeActionFromProposal (params .getContext (), context .getCompilationUnit (), CorrectionMessages .ReorgCorrectionsSubProcessor_organizeimports_description ,
154
- CodeActionKind .SourceOrganizeImports , organizeImportsProposal , QuickAssistComparator .ORGANIZE_IMPORTS_PRIORITY );
154
+ CodeActionKind .SourceOrganizeImports , organizeImportsProposal , CodeActionComparator .ORGANIZE_IMPORTS_PRIORITY );
155
155
addSourceActionCommand ($ , params .getContext (), sourceOrganizeImports );
156
156
}
157
157
@@ -213,12 +213,12 @@ public List<Either<Command, CodeAction>> getSourceActionCommands(CodeActionParam
213
213
// Generate QuickAssist
214
214
if (isInTypeDeclaration ) {
215
215
Optional <Either <Command , CodeAction >> generateToStringQuickAssist = getCodeActionFromProposal (params .getContext (), context .getCompilationUnit (), ActionMessages .GenerateToStringAction_label ,
216
- JavaCodeActionKind .QUICK_ASSIST , generateToStringProposal , QuickAssistComparator .GENERATE_TOSTRING_PRIORITY );
216
+ JavaCodeActionKind .QUICK_ASSIST , generateToStringProposal , CodeActionComparator .GENERATE_TOSTRING_PRIORITY );
217
217
addSourceActionCommand ($ , params .getContext (), generateToStringQuickAssist );
218
218
}
219
219
// Generate Source Action
220
220
Optional <Either <Command , CodeAction >> generateToStringCommand = getCodeActionFromProposal (params .getContext (), context .getCompilationUnit (), ActionMessages .GenerateToStringAction_label ,
221
- JavaCodeActionKind .SOURCE_GENERATE_TO_STRING , generateToStringProposal , QuickAssistComparator .GENERATE_TOSTRING_PRIORITY );
221
+ JavaCodeActionKind .SOURCE_GENERATE_TO_STRING , generateToStringProposal , CodeActionComparator .GENERATE_TOSTRING_PRIORITY );
222
222
addSourceActionCommand ($ , params .getContext (), generateToStringCommand );
223
223
}
224
224
}
@@ -231,7 +231,6 @@ public List<Either<Command, CodeAction>> getSourceActionCommands(CodeActionParam
231
231
Optional <Either <Command , CodeAction >> generateFinalModifiers = addFinalModifierWherePossibleAction (context );
232
232
addSourceActionCommand ($ , params .getContext (), generateFinalModifiers );
233
233
234
- $ .sort (new QuickAssistComparator ());
235
234
return $ ;
236
235
}
237
236
@@ -349,7 +348,7 @@ private Optional<Either<Command, CodeAction>> getOrganizeImportsAction(CodeActio
349
348
CodeAction codeAction = new CodeAction (CorrectionMessages .ReorgCorrectionsSubProcessor_organizeimports_description );
350
349
codeAction .setKind (kind );
351
350
codeAction .setCommand (command );
352
- codeAction .setData (new CodeActionData (null , QuickAssistComparator .ORGANIZE_IMPORTS_PRIORITY ));
351
+ codeAction .setData (new CodeActionData (null , CodeActionComparator .ORGANIZE_IMPORTS_PRIORITY ));
353
352
codeAction .setDiagnostics (Collections .emptyList ());
354
353
return Optional .of (Either .forRight (codeAction ));
355
354
@@ -365,7 +364,7 @@ private Optional<Either<Command, CodeAction>> getOverrideMethodsAction(CodeActio
365
364
CodeAction codeAction = new CodeAction (ActionMessages .OverrideMethodsAction_label );
366
365
codeAction .setKind (kind );
367
366
codeAction .setCommand (command );
368
- codeAction .setData (new CodeActionData (null , QuickAssistComparator .GENERATE_OVERRIDE_IMPLEMENT_PRIORITY ));
367
+ codeAction .setData (new CodeActionData (null , CodeActionComparator .GENERATE_OVERRIDE_IMPLEMENT_PRIORITY ));
369
368
codeAction .setDiagnostics (Collections .emptyList ());
370
369
return Optional .of (Either .forRight (codeAction ));
371
370
} else {
@@ -400,7 +399,7 @@ private Optional<Either<Command, CodeAction>> getGetterSetterAction(CodeActionPa
400
399
TextEdit edit = operation .createTextEdit (pm , accessors );
401
400
return convertToWorkspaceEdit (context .getCompilationUnit (), edit );
402
401
};
403
- return getCodeActionFromProposal (params .getContext (), context .getCompilationUnit (), actionMessage , kind , getAccessorsProposal , QuickAssistComparator .GENERATE_ACCESSORS_PRIORITY );
402
+ return getCodeActionFromProposal (params .getContext (), context .getCompilationUnit (), actionMessage , kind , getAccessorsProposal , CodeActionComparator .GENERATE_ACCESSORS_PRIORITY );
404
403
} else {
405
404
String actionMessage ;
406
405
switch (accessorKind ) {
@@ -422,7 +421,7 @@ private Optional<Either<Command, CodeAction>> getGetterSetterAction(CodeActionPa
422
421
CodeAction codeAction = new CodeAction (actionMessage );
423
422
codeAction .setKind (kind );
424
423
codeAction .setCommand (command );
425
- codeAction .setData (new CodeActionData (null , QuickAssistComparator .GENERATE_ACCESSORS_PRIORITY ));
424
+ codeAction .setData (new CodeActionData (null , CodeActionComparator .GENERATE_ACCESSORS_PRIORITY ));
426
425
codeAction .setDiagnostics (Collections .emptyList ());
427
426
return Optional .of (Either .forRight (codeAction ));
428
427
} else {
@@ -462,7 +461,7 @@ private Optional<Either<Command, CodeAction>> getHashCodeEqualsAction(CodeAction
462
461
CodeAction codeAction = new CodeAction (ActionMessages .GenerateHashCodeEqualsAction_label );
463
462
codeAction .setKind (kind );
464
463
codeAction .setCommand (command );
465
- codeAction .setData (new CodeActionData (null , QuickAssistComparator .GENERATE_HASHCODE_EQUALS_PRIORITY ));
464
+ codeAction .setData (new CodeActionData (null , CodeActionComparator .GENERATE_HASHCODE_EQUALS_PRIORITY ));
466
465
codeAction .setDiagnostics (Collections .emptyList ());
467
466
return Optional .of (Either .forRight (codeAction ));
468
467
} else {
@@ -491,7 +490,7 @@ private Optional<Either<Command, CodeAction>> getGenerateToStringAction(CodeActi
491
490
CodeAction codeAction = new CodeAction (ActionMessages .GenerateToStringAction_ellipsisLabel );
492
491
codeAction .setKind (kind );
493
492
codeAction .setCommand (command );
494
- codeAction .setData (new CodeActionData (null , QuickAssistComparator .GENERATE_TOSTRING_PRIORITY ));
493
+ codeAction .setData (new CodeActionData (null , CodeActionComparator .GENERATE_TOSTRING_PRIORITY ));
495
494
codeAction .setDiagnostics (Collections .emptyList ());
496
495
return Optional .of (Either .forRight (codeAction ));
497
496
} else {
@@ -518,15 +517,15 @@ private Optional<Either<Command, CodeAction>> getGenerateConstructorsAction(Code
518
517
TextEdit edit = GenerateConstructorsHandler .generateConstructors (type , status .constructors , status .fields , params .getRange (), pm );
519
518
return convertToWorkspaceEdit (type .getCompilationUnit (), edit );
520
519
};
521
- return getCodeActionFromProposal (params .getContext (), type .getCompilationUnit (), ActionMessages .GenerateConstructorsAction_label , kind , generateConstructorsProposal , QuickAssistComparator .GENERATE_CONSTRUCTORS_PRIORITY );
520
+ return getCodeActionFromProposal (params .getContext (), type .getCompilationUnit (), ActionMessages .GenerateConstructorsAction_label , kind , generateConstructorsProposal , CodeActionComparator .GENERATE_CONSTRUCTORS_PRIORITY );
522
521
}
523
522
524
523
Command command = new Command (ActionMessages .GenerateConstructorsAction_ellipsisLabel , COMMAND_ID_ACTION_GENERATECONSTRUCTORSPROMPT , Collections .singletonList (params ));
525
524
if (preferenceManager .getClientPreferences ().isSupportedCodeActionKind (JavaCodeActionKind .SOURCE_GENERATE_CONSTRUCTORS )) {
526
525
CodeAction codeAction = new CodeAction (ActionMessages .GenerateConstructorsAction_ellipsisLabel );
527
526
codeAction .setKind (kind );
528
527
codeAction .setCommand (command );
529
- codeAction .setData (new CodeActionData (null , QuickAssistComparator .GENERATE_CONSTRUCTORS_PRIORITY ));
528
+ codeAction .setData (new CodeActionData (null , CodeActionComparator .GENERATE_CONSTRUCTORS_PRIORITY ));
530
529
codeAction .setDiagnostics (Collections .emptyList ());
531
530
return Optional .of (Either .forRight (codeAction ));
532
531
} else {
@@ -551,7 +550,7 @@ private Optional<Either<Command, CodeAction>> getGenerateDelegateMethodsAction(C
551
550
CodeAction codeAction = new CodeAction (ActionMessages .GenerateDelegateMethodsAction_label );
552
551
codeAction .setKind (JavaCodeActionKind .SOURCE_GENERATE_DELEGATE_METHODS );
553
552
codeAction .setCommand (command );
554
- codeAction .setData (new CodeActionData (null , QuickAssistComparator .GENERATE_DELEGATE_METHOD_PRIORITY ));
553
+ codeAction .setData (new CodeActionData (null , CodeActionComparator .GENERATE_DELEGATE_METHOD_PRIORITY ));
555
554
codeAction .setDiagnostics (Collections .EMPTY_LIST );
556
555
return Optional .of (Either .forRight (codeAction ));
557
556
} else {
@@ -570,7 +569,7 @@ private Optional<Either<Command, CodeAction>> addFinalModifierWherePossibleActio
570
569
if (this .preferenceManager .getClientPreferences ().isResolveCodeActionSupported ()) {
571
570
CodeAction codeAction = new CodeAction (ActionMessages .GenerateFinalModifiersAction_label );
572
571
codeAction .setKind (proposal .getKind ());
573
- codeAction .setData (new CodeActionData (proposal , QuickAssistComparator .CHANGE_MODIFIER_TO_FINAL_PRIORITY ));
572
+ codeAction .setData (new CodeActionData (proposal , CodeActionComparator .CHANGE_MODIFIER_TO_FINAL_PRIORITY ));
574
573
codeAction .setDiagnostics (Collections .EMPTY_LIST );
575
574
return Optional .of (Either .forRight (codeAction ));
576
575
} else {
@@ -590,7 +589,7 @@ private Optional<Either<Command, CodeAction>> addFinalModifierWherePossibleActio
590
589
CodeAction codeAction = new CodeAction (ActionMessages .GenerateFinalModifiersAction_label );
591
590
codeAction .setKind (proposal .getKind ());
592
591
codeAction .setCommand (command );
593
- codeAction .setData (new CodeActionData (null , QuickAssistComparator .CHANGE_MODIFIER_TO_FINAL_PRIORITY ));
592
+ codeAction .setData (new CodeActionData (null , CodeActionComparator .CHANGE_MODIFIER_TO_FINAL_PRIORITY ));
594
593
codeAction .setDiagnostics (Collections .EMPTY_LIST );
595
594
return Optional .of (Either .forRight (codeAction ));
596
595
} else {
0 commit comments