How to disabling XML reformating?

I love the reformat feature. However I have some problem when working with XML pattern matching. When the file is reformated a lot of whitespace is added to the XML blocks, and I really can't have them there. Is there a way to turn off XML reformatting, or to indicate that the file should not be reformatted on a commit?

Thanks, Thomas

5 comments
Comment actions Permalink

It seems there is no such option. http://youtrack.jetbrains.net/issue/SCL-2233
Until this will be fixed, you can use format selected text feature.

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

Thanks for the answer, didn't check the bug track.

One thing I have considered is that maybe it would be nice to disable per file. Let's say in some files reformat is fine, in other it's not. Maybe something like a comment that disables XML reformatting:

//#XML-FORMAT KEEP

This is just an idea. Not sure it's a good one, and if this is the correct place to put it.

Thanks for the quick answer,

Thomas

0
Comment actions Permalink

I think this is bad idea. IDE can't offer to put settings into the code. We have per file settings (look at the face in bottom, you can disable import popup per file here). So this is possible to do it, but I'm not sure that it will be implemented per file.

Best regards,
Alexander Podkhalyuzin.

0
Comment actions Permalink

I still think having reformat can be helpful in some cases. But in some cases you main not want that. I understand that adding things in comment is really not the way to go. But I was looking at my code, and sometimes it wrap XML in parenthesis. Could the reformat be made so that it will not reformat XML in this format, or is this again a bad idea?

val xml = (<xmlNotToFormat>.... </xmlNotToFormat>)
0
Comment actions Permalink

It's not bad idea. I think we ought to add same settings for XML formatting.
Created issue: http://youtrack.jetbrains.net/issue/SCL-2290
But I can't promise fast fix, sorry.

Best regards,
Alexander Podkhalyuzin.

0

Please sign in to leave a comment.