Skip to content
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

Merged
merged 5 commits into from
Apr 15, 2019

Conversation

testforstephen
Copy link
Contributor

Signed-off-by: Jinbo Wang [email protected]

Closes #736

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);
Copy link
Contributor

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?

Copy link
Contributor Author

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.

@testforstephen
Copy link
Contributor Author

test this please

Copy link
Contributor

@fbricon fbricon left a 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

@testforstephen
Copy link
Contributor Author

Nice finding. The toString source action will return a WorkspaceEdit directly if no non-static fields exist in the class.

@testforstephen
Copy link
Contributor Author

test this please

Signed-off-by: Jinbo Wang <[email protected]>
@fbricon fbricon merged commit 984afa3 into eclipse-jdtls:master Apr 15, 2019
@testforstephen testforstephen deleted the jinbo_tostring branch April 16, 2019 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add code action to generate toString() method
2 participants