Export Intellij IDEA code formatting rules to Eclipse
Asked Answered
D

3

12

Is there a way to generate a eclipse code formatter xml which matches Intellij IDEA code formatting rules?

Dissuasive answered 24/3, 2015 at 6:54 Comment(2)
Were you able to figure this out? I've got the same issue. I'm now working with a team that uses Eclipse and I need to export our company CodeStyles and Formatting for them to adopt.Covert
Sorry. I couldn't find a wayDissuasive
H
2

If CheckStyle is an option for you, consider using it as 'single source of truth':

  • create CheckStyle config
  • install CheckStyle plugins in both Eclipse and IDEA
  • import formatter configs from CheckStyle config

See answers to related question.

I haven't tried it yet.

Hyperborean answered 26/4, 2016 at 16:9 Comment(0)
S
1

At the moment there is no way to export IntelliJ code style to eclipse. You need to do it the other way around.

You can also check IntelliJ plugin called "Eclipse Code Formatter" (link), but it the same way, from Eclipse to IntelliJ.

I'm using IntelliJ 14.1.4

Squalid answered 25/6, 2015 at 10:6 Comment(0)
J
1

Try this:

  1. In IntelliJ, File -> Settings -> Editor -> Code Style -> Java, click the gear icon then Export -> Eclipse XML Profile: enter image description here
  2. In Eclipse, Window -> Preferences -> Java -> Code Style -> Formatter -> Import; ensure your imported profile is selected as the Active profile and Apply:enter image description here

Screenshots are from IntelliJ IDEA 2022.3.2 (Community Edition) and Eclipse 2022-03 (4.23.0)

Jon answered 18/4, 2023 at 21:17 Comment(3)
I thought this had worked, but apparently this option has been removed in newer versions of Intellij.Tetchy
@snowe, It still shows up for me with IntelliJ IDEA 2023.3.5 (Ultimate Edition) on MacOS.Jon
hmm. I'm literally on the exact same version (and ultimate, and mac) and I'm only getting a single export option. When I click it it opens a save dialog for the default jetbrains xml. I tested that it wasn't a difference between the new UI and old UI as well...Tetchy

© 2022 - 2024 — McMap. All rights reserved.