-
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
Add code action: Generate toString()... #988
Conversation
Signed-off-by: Jinbo Wang <[email protected]>
Signed-off-by: Jinbo Wang <[email protected]>
Assert.assertEquals(codeActions.get(0).getRight().getKind(), CodeActionKind.QuickFix); | ||
Assert.assertEquals(codeActions.get(1).getRight().getKind(), CodeActionKind.QuickFix); | ||
Assert.assertEquals(codeActions.get(2).getRight().getKind(), CodeActionKind.SourceOrganizeImports); | ||
Assert.assertEquals(codeActions.get(3).getRight().getKind(), JavaCodeActionKind.SOURCE_OVERRIDE_METHODS); |
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.
why is this code action no longer returned?
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.
it still returned. I refactor this test case because this test method name is removeUnusedImport
. Checking all code action list is just a byproduct. Every time, a new source action is added, we need fix this case. so i refactor this test case and let it focus on checking removeUnusedImport
related code action only.
…ringBuilder Signed-off-by: Jinbo Wang <[email protected]>
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.
There's no need to send a client request if there are no fields to choose from
e0f51a4
to
efc9828
Compare
Nice finding. The toString source action will return a WorkspaceEdit directly if no non-static fields exist in the class. |
Signed-off-by: Jinbo Wang <[email protected]>
efc9828
to
b9eb9a6
Compare
test this please |
...lipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/GenerateToStringHandler.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Jinbo Wang <[email protected]>
Signed-off-by: Jinbo Wang [email protected]
Closes #736