EclipseCodeFormatter icon indicating copy to clipboard operation
EclipseCodeFormatter copied to clipboard

Formatter not working anymore with newest IDEA version.

Open juzi opened this issue 4 years ago • 6 comments

The formatter formats method signatures in a weird way. Im using

  • Ubuntu Linux 20.04.3 LTS
  • IDEA version (now 2021.3.2)
  • plugin version 22.0.203.000.0-Eclipse_2021-09
  • eclipse installation 2019-09 R (4.13.0) (The issue persists with eclipse Version: 2021-12 (4.22.0))
  • attached eclipse code format file (file ending changed from .xml to .txt for upload)

If the formating is different than expected:

  • make sure you are comparing with the same Eclipse version
  • provide a code example (both from Eclipse and from IntelliJ) and settings files

The only things that changed recently are the IDEA version and maybe the plugin version

What steps will reproduce the issue?

Format the code of a Java file.

What is the expected result?

    Boolean existsVorbildungForExtStudId(@WebParam(name = "extStudId") String extStudId,
            @WebParam(name = "vorbildungArtCode") String vorbildungArtCode,
            @WebParam(name = "ausstellungsDatum") Date ausstellungsDatum,
            @WebParam(name = "landIsoCode") String landIsoCode);

What happens instead?

    Boolean existsVorbildungForExtStudId(@WebParam(name = "extStudId")
    String extStudId,
            @WebParam(name = "vorbildungArtCode")
            String vorbildungArtCode,
            @WebParam(name = "ausstellungsDatum")
            Date ausstellungsDatum,
            @WebParam(name = "landIsoCode")
            String landIsoCode);

Сonsider attaching a screenshot, screencast, or a code sample when it's hard to articulate the problem.

code_format.txt

juzi avatar Feb 08 '22 14:02 juzi

I got the same behavior. setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="insert"

switch this line to setting id="org.eclipse.jdt.core.formatter.insert_new_line_after_annotation" value="do not insert"

seems it is now working as expected

vincentLozach avatar Feb 18 '22 10:02 vincentLozach

Could you please specify in which file I would have to change this line?

juzi avatar Feb 18 '22 10:02 juzi

In your code_format.txt in this issue

vincentLozach avatar Feb 18 '22 12:02 vincentLozach

thanks, I thought it was a setting in the plugin/IDEA.

juzi avatar Feb 18 '22 12:02 juzi

So everything is fine then?

krasa avatar Mar 01 '22 23:03 krasa

Yes, this fixed the issue, sorry for the late reply.

juzi avatar Mar 02 '22 06:03 juzi