krasa / EclipseCodeFormatter

IntelliJ plugin - use Eclipse's code formatter directly from IntelliJ. https://plugins.jetbrains.com/plugin/6546
Apache License 2.0
487 stars 117 forks source link

Formatter not working anymore with newest IDEA version. #242

Closed juzi closed 2 years ago

juzi commented 2 years ago

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

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

vincentLozach commented 2 years ago

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

juzi commented 2 years ago

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

vincentLozach commented 2 years ago

In your code_format.txt in this issue

juzi commented 2 years ago

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

krasa commented 2 years ago

So everything is fine then?

juzi commented 2 years ago

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