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 Generate Constructor to Show Fixes for type declaration #1937

Merged

Conversation

CsCherrYY
Copy link
Contributor

constructor

Part of redhat-developer/vscode-java#2057

If the quick fix is triggered in type declaration, the generated code will be after the last field declaration.

Signed-off-by: Shi Chen [email protected]

public static IJavaElement findInsertElementAfterLastField(IType type) {
int lastOffset = 0;
try {
IJavaElement[] members = type.getChildren();
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since the results of IParent.getChildren() are in no particular order, we have to call findElementAfterPosition after we find the last field.

@CsCherrYY CsCherrYY force-pushed the cs-quickfix-constructor branch from 112cd65 to 5e270b5 Compare November 11, 2021 03:18
@CsCherrYY CsCherrYY marked this pull request as ready for review November 11, 2021 03:18
@testforstephen testforstephen added this to the Mid November milestone Nov 24, 2021
@testforstephen testforstephen merged commit e804ec3 into eclipse-jdtls:master Nov 24, 2021
@CsCherrYY CsCherrYY deleted the cs-quickfix-constructor branch June 30, 2022 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants