Is there a format XML command?
Answered
I can't seem to find any command to reformat the xml I am working on. Often I may cut and paste pieces of XML to create a new XML file but the indentation on different pieces may be inconsistent so I was expecting there would be a command to reformat the file, but I can't seem to find one anywhere. For now I have been copying the whole thing into my XML editor (XMLBluePrint) reformatting it there then pasted the reformatted code back into IDEA, seems like a lot of work so I must be missing something.
I'm using IDEA 15.0.1 Ultimate
Thanks for any pointers.,
Please sign in to leave a comment.
Right in the main menu: "Code => Reformat Code" or just Ctrl-Alt-L
Or "Help => Find Action" (which is Ctrl-Shift-A), then type "format"
My IntelliJ seems to have stopped formatting XML. Is there a setting that might account for this?
Check it's mapped to the correct file type, see https://stackoverflow.com/a/13374653/104891.
Thanks Serge. It's a good idea, but that's not it. XML is mapped to *.xml
Please contact support at https://intellij-support.jetbrains.com/hc/requests/new with the sample file that doesn't format (or a project with your code style saved) plus the logs via Help | Collect Logs and Diagnostic Data.
Has there been a resolution to this? My IntelliJ also stopped formatting XML.
Jonathanl Please read the previous comment.
If you mean the file type mapping, I already tried that.
Jonathanl No, I mean the comment about reporting it to support with the sample file and the logs.