A fix for WI-28533 Code reformat does not reformat PHP when the file is named pi.json.php

This commit is contained in:
Rustam Vishnyakov
2015-11-03 17:12:38 +03:00
parent 7db292ea8d
commit 24d322abcd
2 changed files with 7 additions and 0 deletions
+1
View File
@@ -15,5 +15,6 @@
<orderEntry type="module" module-name="xml-openapi" />
<orderEntry type="module" module-name="spellchecker" />
<orderEntry type="library" name="Guava" level="project" />
<orderEntry type="module" module-name="webide-impl" />
</component>
</module>
@@ -13,9 +13,11 @@ import com.intellij.psi.PsiFile;
import com.intellij.psi.TokenType;
import com.intellij.psi.codeStyle.CodeStyleSettings;
import com.intellij.psi.codeStyle.CommonCodeStyleSettings;
import com.intellij.psi.templateLanguages.OuterLanguageElement;
import com.intellij.psi.tree.TokenSet;
import com.intellij.util.Function;
import com.intellij.util.containers.ContainerUtil;
import com.intellij.webcore.template.formatter.TemplateFormatUtil;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
@@ -142,6 +144,10 @@ public class JsonBlock implements ASTBlock {
}
}
}
if (childNode.getPsi() instanceof OuterLanguageElement) {
Block templateBlock = TemplateFormatUtil.buildTemplateLanguageBlock((OuterLanguageElement)childNode.getPsi(), mySettings, indent);
if (templateBlock != null) return templateBlock;
}
return new JsonBlock(this, childNode, mySettings, alignment, indent, wrap);
}