Reputation: 1677
I want to use a specific code style in my editor defined in an XML file, which looks something like this:
<code_scheme name="CustomStyleName">
<option name="JAVA_INDENT_OPTIONS">
<value>
...
How is it possible to import this style into IntelliJ Idea. When I go to Preferences->Editor->Code Style->Manage it is only possible to import an Eclipse XML Profile.
Upvotes: 18
Views: 37055
Reputation: 1818
For users coming here for the same issue but recent IntelliJ version (like 20), it is a bit different now. Once you've exported your formatter in XML, then follow these steps:
If you see error "IntelliJ IDEA code style XML import failed with error message: null", check to ensure your XML file has the file definition <?xml version="1.0" encoding="UTF-8"?>
at the top.
NOTE: This is for MacBook. I believe the difference won't be much in other platforms.
Upvotes: 17
Reputation: 1110
If your XML is previously exported Intellij you can simply do:
File > Import Settings > select your xml
If its custom defined, one you can try copying your xml to intellij config directory:
config/codestyles
Assuming your xml is in format intellij can understand, it will then show up in
Code Styles > Manage
If your XML is in different format, try to match tags with one of pre-defined styles(also XML)
Upvotes: 22