Sharing code styles

Hello,

I would like to share the xml file that defines codestyles, e.g. position of
braces, etc.

When I define a codestyle in "IDE Settings - Code Style" the settings are
saved in a named xml file.
If I send that xml file to a colleague and have them put it in their config
| codestyles dir, it does not appear as one of the saved codestyles.
Even if
1. shut down intelliJ
2. copy xml file to codestyles
3. edit options | codestyle.schemes.xml to point to the new xml file
4. startup IntelliJ

it still will not load the new xml file, it simply reverts to default.

Does anyone know of any tricks to use so that all programmers on the same
project can share a single codestyle?

Thanks,

Ted Hill


8 comments

We are doing just that and it works fine.

The only difference is that we do not edit any xml
file (step 4 below).

After copying the xml file to the config/codestyles folder and
restaring IDEA go to "IDE Settings" / "Code Style" and
select the new "Scheme name" from the drop down list.

Also under "Project Properties" / "Miscellaneous" make
sure that either "Use per-project code style scheme"
is not checked or it points to the proper scheme.

Marius


Ted Hill wrote:

Hello,

I would like to share the xml file that defines codestyles, e.g. position of
braces, etc.

When I define a codestyle in "IDE Settings - Code Style" the settings are
saved in a named xml file.
If I send that xml file to a colleague and have them put it in their config
| codestyles dir, it does not appear as one of the saved codestyles.
Even if
1. shut down intelliJ
2. copy xml file to codestyles
3. edit options | codestyle.schemes.xml to point to the new xml file
4. startup IntelliJ

it still will not load the new xml file, it simply reverts to default.

Does anyone know of any tricks to use so that all programmers on the same
project can share a single codestyle?

Thanks,

Ted Hill


0

I still don't see how to do this.

If I define the styles on my machine, then send the xml file for the styles
to other developers, they copy to their codestyles dir.
When starting IntelliJ, the new scheme name does not appear, and in fact
IntelliJ deletes the newly copied xml file.

I'm using build 693 on windows. Also had the same problem with build 688.

Any other suggestions?

Thanks,

Ted Hill


"Marius Scurtescu" <mscurtescu@healthmetrx.com> wrote in message
news:3E4A8085.50701@healthmetrx.com...

We are doing just that and it works fine.

>

The only difference is that we do not edit any xml
file (step 4 below).

>

After copying the xml file to the config/codestyles folder and
restaring IDEA go to "IDE Settings" / "Code Style" and
select the new "Scheme name" from the drop down list.

>

Also under "Project Properties" / "Miscellaneous" make
sure that either "Use per-project code style scheme"
is not checked or it points to the proper scheme.

>

Marius

>
>

Ted Hill wrote:

Hello,

>

I would like to share the xml file that defines codestyles, e.g.

position of

braces, etc.

>

When I define a codestyle in "IDE Settings - Code Style" the settings

are

saved in a named xml file.
If I send that xml file to a colleague and have them put it in their

config

| codestyles dir, it does not appear as one of the saved codestyles.
Even if
1. shut down intelliJ
2. copy xml file to codestyles
3. edit options | codestyle.schemes.xml to point to the new xml file
4. startup IntelliJ

>

it still will not load the new xml file, it simply reverts to default.

>

Does anyone know of any tricks to use so that all programmers on the

same

project can share a single codestyle?

>

Thanks,

>

Ted Hill

>
>

>


0

I too am using 693 on windows NT.
The only time I've seen it delete the xml file is if you copy it into the codestyles directory when IDEA is running. You must copy it in before starting IDEA.

Hope this helps

0

Vote for bug 8457 if you would like an easier way to share coding styles and
keymaps across a group of users :)

"Andrew Cowling" <jiveadmin@jetbrains.com> wrote in message
news:12730068.1045086461091.JavaMail.jrun@is.intellij.net...

I too am using 693 on windows NT.
The only time I've seen it delete the xml file is if you copy it into the

codestyles directory when IDEA is running. You must copy it in before
starting IDEA.
>

Hope this helps



0

On 693:

1. Copy xml code style definition to config/codestyles dir BEFORE starting
IntelliJ
2. Start IntelliJ
3. Open IDE Settings CodeStyle dialog
4. The named scheme from #1 is not displayed in the drop down
5. Open Windows explorer, look in the config/codestyles dir
6. The xml file copied to config/codestyles in step #1 is now gone.

Why won't it work for me?


"Andrew Cowling" <jiveadmin@jetbrains.com> wrote in message
news:12730068.1045086461091.JavaMail.jrun@is.intellij.net...

I too am using 693 on windows NT.
The only time I've seen it delete the xml file is if you copy it into the

codestyles directory when IDEA is running. You must copy it in before
starting IDEA.
>

Hope this helps



0

I don't think it makes a difference when you copy in the code style (i.e. before starting IDEA or while it's running). IDEA is gonna wipe it out if it doesn't "recognize" the file.

As a workaround, have you tried first creating a placeholder code style (just make it a copy of the Default) with the exact same name as the one you're trying to copy over? Doing so should "register" that code style name with IDEA and create the corresponding XML file. You should then be able to quit IDEA, overwrite your placeholder code style with the real one and then restart IDEA. I haven't tried it, but I think that'll work.

Good luck.

chris

0

I should clarify that when I mentioned making a copy of the Default code style, I meant doing so from within IDEA by clicking IDE Settings --> Code Style --> Save As... and then just specifying a name that exactly matches the shared one you're trying to use.

0

Please sign in to leave a comment.