Unable to import a code style xml format file

Hello!!

I recently installed intellij 7.0.3 on my system. We have a code format file for our project that we all use to keep code formatting cosistent across team. I couldn't find an option in intellij which alllows me to import a xml file for code formatting. There are options for manually set it up but I was wondering there should be an option to import a xml file format. In eclipse there is an option to import it.

Thanks,
Ankit

9 comments
Comment actions Permalink

Hello.

Does this XML contain IDEA code style settings, or it's format is something different?

Alexander.

0
Comment actions Permalink

Thanks Alexander,

Currently we have eclipse code style Xml format. So, It would be great if we can directly import formats from eclipse.

Otherwise, even if we can import idea code style formatting, the option can be to set it up on one system and then import on other machines.
Even that would be a great solution if it is possible.


Thanks
Ankit

0
Comment actions Permalink

There is no feature to import Eclipse formatting settings directly. JIRA issue is http://www.jetbrains.net/jira/browse/IDEABKL-5188

In IDEA two options exist: to store code style settings in the application-level config or in the project file. See Settings dialog / Code Style / "Use global settings" and "Use per project settings". In the second case code style is shared between team members via version control - as soon as the project file is added to VCS.

Alexander.

0
Comment actions Permalink

Hey Alexander!!

Thanks for the reply. I was checking the option of import and export code style through project code style using per project code style setting as you mentioned.

It looks like there is an option to export settings where it exports to default location with in intellij folder. And I couldn't find an option to import an Xml file from external location. If we click for import it just gives the available files to import which are nothing but our previously saved configuration. One more thing I am running it on mac, so is it like I am facing this problem only in mac.

Thanks
Ankit

0
Comment actions Permalink

> And I couldn't find an option to import an Xml file from external location.

For this get an XML with IDEA code style settings, exit IDEA, put XML into [config directory]/codestyles/ (where other code style schemes are stored), and restart IDEA. IDE just picks up all scheme files it finds in specified directory.

Alexander.

0
Comment actions Permalink

... Just notice that schemes stored in config directory are individual for the user and not shared between team members automatically.

0
Comment actions Permalink

So, the only way for setting a uniform code style formatting would be to to export and check in your desired configuration to the VCS and ask your team to check out the code style file and copy to the code style folder of intellij. Doesn't sound too great for maintaining subsequent code style changes.

Thanks,
Ankit

0
Comment actions Permalink

No, another option is to save a code style in the project file and put the project file into VCS. (Project file is .ipr. Normally it is versionned.)

Alexander.

0
Comment actions Permalink

Oh ok, i got your point. Till now we haven't kept ipr file as versioned but yes that's an option we could think of.

Thanks for your help.

Thanks
Ankit

0

Please sign in to leave a comment.