[indent-detector] do not build injected blocks in xml

This commit is contained in:
Yaroslav Lepenkin
2016-06-17 19:35:39 +03:00
parent de45938624
commit fb13b9dec4
2 changed files with 12 additions and 5 deletions
@@ -56,8 +56,14 @@ public abstract class AbstractIndentAutoDetectionTest extends LightPlatformCodeI
}
protected void doTestIndentSize(int expectedIndent) {
configureByFile(getFileNameWithExtension());
doTestIndentSize(null, expectedIndent);
}
protected void doTestIndentSizeFromText(String text, @Nullable CommonCodeStyleSettings.IndentOptions options, int expectedIndent) {
configureFromFileText(getFileNameWithExtension(), text);
doTestIndentSize(options, expectedIndent);
}
protected void doTestTabsUsed(@Nullable CommonCodeStyleSettings.IndentOptions defaultIndentOptions) {
configureByFile(getFileNameWithExtension());
@@ -70,9 +76,7 @@ public abstract class AbstractIndentAutoDetectionTest extends LightPlatformCodeI
Assert.assertTrue("Tab usage not detected", options.USE_TAB_CHARACTER);
}
private void doTestIndentSize(@Nullable CommonCodeStyleSettings.IndentOptions defaultIndentOptions, int expectedIndent) {
configureByFile(getFileNameWithExtension());
private static void doTestIndentSize(@Nullable CommonCodeStyleSettings.IndentOptions defaultIndentOptions, int expectedIndent) {
if (defaultIndentOptions != null) {
setIndentOptions(defaultIndentOptions);
}
@@ -201,10 +201,11 @@ public abstract class AbstractXmlBlock extends AbstractBlock {
processSimpleChild(child, indent, result, wrap, alignment);
return child;
}
else {
else if (!isBuildIndentsOnly()) {
myInjectedBlockBuilder.addInjectedLanguageBlockWrapper(result, child, indent, 0, null);
return child;
}
return child;
}
protected boolean doesNotIntersectSubTagsWith(final PsiElement tag) {
@@ -435,6 +436,8 @@ public abstract class AbstractXmlBlock extends AbstractBlock {
}
protected boolean buildInjectedPsiBlocks(List<Block> result, final ASTNode child, Wrap wrap, Alignment alignment, Indent indent) {
if (isBuildIndentsOnly()) return false;
if (myInjectedBlockBuilder.addInjectedBlocks(result, child, wrap, alignment, indent)) {
return true;
}