-
Notifications
You must be signed in to change notification settings - Fork 456
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
Generate toString() source action should support inclusion of methods #2639
Generate toString() source action should support inclusion of methods #2639
Comments
I think this is possible with just adjusting how we use the We don't need to support all of these, but clearly generation from methods is supported. Also, in case anyone is interested, here is where we set defaults for most of these settings : https://github.com/eclipse/eclipse.jdt.ls/blob/a33760778e3c6e5433cde02f45cba972e6c20159/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/GenerateToStringHandler.java#L115 . Update :
Once all of that is done, https://github.com/eclipse/eclipse.jdt.ls/blob/a33760778e3c6e5433cde02f45cba972e6c20159/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/GenerateToStringHandler.java#L149 is where the selected members get passed in for the |
It would be helpful to add an option to generate a toString with getters instead of attribute names because it would allow the toString to work automatically in subclasses where the getters might be overridden. Currently, the dialog only allows you to select which attributes to include in the toString. It seems like it would be relatively simple to add a checkbox (or maybe a separate dialog box) that allows the user to select whether to use attribute names or getters.
The text was updated successfully, but these errors were encountered: