mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[indent-detector] do not build injected blocks in xml
This commit is contained in:
+7
-3
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user