Skip to content

Commit

Permalink
IDEA-146417 Formatting of closing tag in XML is inconsistent with pre…
Browse files Browse the repository at this point in the history
…vious versions
  • Loading branch information
dmitry-avdeev committed Oct 30, 2015
1 parent 571cba1 commit e45c1bd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,7 @@
*/
package com.intellij.psi.formatter.xml;

import com.intellij.formatting.Block;
import com.intellij.formatting.FormattingDocumentModel;
import com.intellij.formatting.FormattingModelBuilder;
import com.intellij.formatting.WrapType;
import com.intellij.formatting.*;
import com.intellij.lang.ASTNode;
import com.intellij.lang.Language;
import com.intellij.lang.LanguageFormatting;
Expand Down Expand Up @@ -137,6 +134,8 @@ public int getBlankLinesBeforeTag(XmlTag xmlTag) {

public abstract int getWhiteSpaceAroundCDATAOption();

public Indent getTagEndIndent() { return Indent.getNoneIndent(); }

public abstract CodeStyleSettings getSettings();

public boolean processJsp() {
Expand All @@ -159,7 +158,6 @@ public boolean processJavaTree() {
return myProcessJavaTree;
}


public void dontProcessJavaTree() {
myProcessJavaTree = false;
}
Expand Down
4 changes: 2 additions & 2 deletions xml/impl/src/com/intellij/psi/formatter/xml/XmlTagBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected List<Block> buildChildren() {
Alignment alignment = chooseAlignment(child, attrAlignment, textAlignment);

if (child.getElementType() == XmlTokenType.XML_TAG_END) {
child = processChild(localResult,child, wrap, alignment, Indent.getNoneIndent());
child = processChild(localResult,child, wrap, alignment, myXmlFormattingPolicy.getTagEndIndent());
result.add(createTagDescriptionNode(localResult));
localResult = new ArrayList<Block>(1);
insideTag = true;
Expand All @@ -91,7 +91,7 @@ else if (child.getElementType() == XmlTokenType.XML_END_TAG_START) {
}
child = processChild(localResult,child, wrap, alignment, null);
} else if (child.getElementType() == XmlTokenType.XML_EMPTY_ELEMENT_END) {
child = processChild(localResult,child, wrap, alignment, Indent.getNoneIndent());
child = processChild(localResult,child, wrap, alignment, myXmlFormattingPolicy.getTagEndIndent());
result.add(createTagDescriptionNode(localResult));
localResult = new ArrayList<Block>(1);
}
Expand Down

0 comments on commit e45c1bd

Please sign in to comment.