vscode-java
vscode-java copied to clipboard
toString Generator shows fields in wrong order
Environment
- Operating System: Windows 10
- JDK version: 17
- Visual Studio Code version: 1.68.0
- Java extension version: 0.23.0
Description
toString Generator shows fields in the wrong order leading to code generated in the wrong order too.

Expected result:
Fields should show in correct order like the constructor.

@CsCherrYY Looks like another code action ux related issue. Guess you might be interested in this. :)
we now get the candidate list via ITypeBinding.getDeclaredFields(): https://github.com/eclipse/eclipse.jdt.ls/blob/726ece1d1fd26480028c217f1d27193f4cd05760/org.eclipse.jdt.ls.core/src/org/eclipse/jdt/ls/core/internal/handlers/JdtDomModels.java#L60
The return array seems to not be in particular order. Maybe IType.getFields() returns the correct definition order.