jhipster / prettier-java

Prettier Java Plugin
http://www.jhipster.tech/prettier-java/
Apache License 2.0
1.06k stars 103 forks source link

Indentation issues since 2.3.0 #601

Closed MLNW closed 10 months ago

MLNW commented 10 months ago

Prettier-Java 2.3.0

{
  "useTabs": false,
  "trailingComma": "none",
  "printWidth": 100,
  "tabWidth": 2,
  "plugins": ["prettier-plugin-java"],
  "overrides": [
    { "files": "*.java", "options": { "tabWidth": 4 } }
  ]
}

Input:

            fileSystemDetails =
                FileHandlerDetails
                    .builder()
                    .fileSystemType(
                        EntityUtils.update(
                            entity.getFileSystemDetails().getFileSystemType(),
                            update.getFileSystemDetails().getFileSystemType()
                        )
                    )

Output:

            fileSystemDetails =
            FileHandlerDetails
                .builder()
                .fileSystemType(
                    EntityUtils.update(
                        entity.getFileSystemDetails().getFileSystemType(),
                        update.getFileSystemDetails().getFileSystemType()
                    )
                )

Expected behavior:

The input should stay the same.

Workaround:

Stay on v2.2.0.

Magotchi commented 10 months ago

I'm seeing this problem in a lot of code and am remaining on 2.2.0 to work around it.

pascalgrimaud commented 10 months ago

Cc @clementdessoude : I'm adding a bounty for having a fix on this

jtkiesel commented 10 months ago

This appears to have been caused by #594. I'll begin working on a fix.

jtkiesel commented 10 months ago

@clementdessoude @pascalgrimaud We should probably release 2.3.1 with this fix, or else anyone who upgrades to 2.3.0 will experience this issue and likely be forced to downgrade back to 2.2.0.

pascalgrimaud commented 10 months ago

Yes, if @clementdessoude is not available to do that, I'll do a release

clementdessoude commented 10 months ago

Thanks for the fix @jtkiesel and the review @pascalgrimaud, launching the release right now !

pascalgrimaud commented 10 months ago

@jtkiesel : don't forget to claim the bounty here

jtkiesel commented 10 months ago

@pascalgrimaud Bounty claimed: https://opencollective.com/generator-jhipster/expenses/159786

pascalgrimaud commented 10 months ago

@jtkiesel : approved