Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge (instead of overriding) IDEA's code style config #211

Closed
a141199 opened this issue May 11, 2018 · 6 comments
Closed

Merge (instead of overriding) IDEA's code style config #211

a141199 opened this issue May 11, 2018 · 6 comments

Comments

@a141199
Copy link

a141199 commented May 11, 2018

Is there a way to get this feature back? it used to move things like ID to the top and all other kinds of niceties.

@shyiko
Copy link
Collaborator

shyiko commented May 16, 2018

Hi.
I'm not sure what you mean but if you are seeing a different behavior in the way Intellij handles XML after you applied ktlint --apply-to-idea-project - you must have had a custom code style. You can switch to a previous scheme / change the settings by going to File -> Settings... -> Editor -> Code Style -> XML.

@YuraLaguta
Copy link

YuraLaguta commented May 23, 2018

@shyiko the problem is that ktlint --apply-to-idea-project removes some very valuable settings from ".idea/codeStyles/Project.xml" is there a way to merge them? or add some without removing everything else? or add those configurations to ktlint --apply-to-idea-project --android
this is most likely part responsible for that: https://gist.github.com/Yurii-Laguta/846626db13de851926aee6393bb3ba3a

@shyiko
Copy link
Collaborator

shyiko commented May 23, 2018

Thank you, @Yurii-Laguta. I'll take a look.

@shyiko shyiko changed the title Before installing ktlint AS autoformat used to rearrange xml Merge (instead of overriding) IDEA's code style config Feb 12, 2019
@arunvelsriram
Copy link

I was looking into the code for fixing this issue. I would like to clarify my understanding of the expected behavior.

Actual behavior:

.idea/codeStyles/Project.xml is replaced by ktlint/src/main/resources/project-config/.idea/codeStyles/Project.xml

Expected behavior:

If .idea/codeStyles/Project.xml exists then merge it with ktlint/src/main/resources/project-config/.idea/codeStyles/Project.xml. When merging, the contents of ktlint/src/main/resources/project-config/.idea/codeStyles/Project.xml will be given higher preference.

@Tapchicoma
Copy link
Collaborator

When merging, the contents of ktlint/src/main/resources/project-config/.idea/codeStyles/Project.xml will be given higher preference.

I would say this should depend on --force flag value.

@romtsn
Copy link
Collaborator

romtsn commented Dec 2, 2020

Closing this as we are going to deprecate the current IDEA-integration in favor of integration via .editorconfig (#701)

@romtsn romtsn closed this as completed Dec 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants