-
Notifications
You must be signed in to change notification settings - Fork 408
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
show generate toString()/hashCode() and equals() quick fixes on demand #2213
show generate toString()/hashCode() and equals() quick fixes on demand #2213
Conversation
test this please |
Signed-off-by: Shi Chen <[email protected]>
c4be6ba
to
a04edce
Compare
test this please |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall change looks good to me. So once the small issue with tests is addressed, feel free to merge this.
@@ -177,4 +177,23 @@ public void testGenerateToStringQuickAssist_emptyFields() throws JavaModelExcept | |||
quickAssistActions = CodeActionHandlerTest.findActions(codeActions, JavaCodeActionKind.QUICK_ASSIST); | |||
Assert.assertFalse(CodeActionHandlerTest.commandExists(quickAssistActions, CodeActionHandler.COMMAND_ID_APPLY_EDIT, ActionMessages.GenerateToStringAction_label)); | |||
} | |||
|
|||
@Test | |||
public void testGenerateToStringQuickAssistExists() throws JavaModelException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For this method and the one below. Instead of calling them testGenerateToStringQuickAssistExists
, testHashCodeEqualsQuickAssistExists
, I would call them testNoGenerateToStringQuickAssist
& testNoHashCodeEqualsQuickAssist
.
Basically, the current name implies that the quick-assist should exist, but I know what you mean is that the method exists so the quick-assist shouldn't. It just might be confusing with the current name.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, Let's make them clear.
Signed-off-by: Shi Chen <[email protected]>
Signed-off-by: Shi Chen [email protected]
This PR will detect the methods of the current type, and choose which quick fix to show.If the current type has corresponding:
Please note that this change will not affect "Source Action" in the right click menu, the "Source Action" part will always show them in case of the user wants to override the methods anyway.