Intellij idea IntelliJ Idea没有';t在jspx文件为“时重新格式化”;“长”;

Intellij idea IntelliJ Idea没有';t在jspx文件为“时重新格式化”;“长”;,intellij-idea,Intellij Idea,我在Intellij Idea中发现了一种奇怪的行为。在一个大约300行的复杂jspx页面中,intellij idea无法再正确格式化代码 编辑:此问题仅在页面另存为.jspx时出现。如果将其另存为.xml,问题就会消失 例如,本页: <?xml version="1.0" encoding="UTF-8" standalone="yes" ?> <jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0"

我在Intellij Idea中发现了一种奇怪的行为。在一个大约300行的复杂jspx页面中,intellij idea无法再正确格式化代码

编辑:此问题仅在页面另存为.jspx时出现。如果将其另存为.xml,问题就会消失

例如,本页:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:my="http://java.sun.com/jsf/composite/mycomponents"
    >
<ui:composition>
<f:view>
<p:panel header="XXX">
<p:outputLabel value="YYY"/>
</p:panel>
</f:view>
</ui:composition>
</jsp:root>

当我点击Ctrl+Alt+L时,我得到了正确的输出:

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" version="2.0" xmlns="http://www.w3.org/1999/xhtml"
      xmlns:c="http://java.sun.com/jsp/jstl/core" xmlns:fmt="http://java.sun.com/jsp/jstl/fmt"
      xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:my="http://java.sun.com/jsf/composite/mycomponents"
    >

<ui:composition>
    <f:view>
        <p:panel header="XXX">
            <p:outputLabel value="YYY"/>
        </p:panel>
    </f:view>
</ui:composition>
</jsp:root>

但是当我在页面中粘贴
大约300次时,自动格式化就停止了

在更复杂的示例中,只有部分代码被格式化(例如,
p:panel
中的所有内容都被格式化,但是
ui:composition
f:view
保持在相同的位置(无缩进)

我在idea中找不到任何有帮助的配置。有没有办法摆脱这种行为


我使用Intellij Idea 12 Ultimate(Intellij Idea 12 Ultimate)(Intellij Idea 12 Ultimate)(Intellij Idea 12 Ultimate)(Intellij Idea 12 Ultimate)(Intellij Idea 12 Ultimate)(Intellij Idea 12 Ultimate)(Intellij Idea 12 Ultimate)(Intellij Idea 12 Ultimate)(Intellij Idea 12 Ultimate)(Intellij Idea 12 Ultimate)(Intellij Idea 12 Ultimate)(p)更新)(该缺陷

这个错误可能是错误的


这似乎是一个bug,请投票。

idea中有此行为的设置:

请在:CodeStyle | HTML | Other |中调整设置,如果标记大小超过行,则不要缩进子项


我刚试过2500个左右的
,Intellij Idea 13没有问题。Intellij Idea日志中有错误吗?(“C:\Users\$user\.IntelliJIdea12\system\log\Idea.log”)我认为格式化本身是可以的。当我使用长格式的XML并按Ctrl+Alt+F时,缩进消失了。我无法格式化的文件示例如下:似乎是个bug。IntelliJ 12.1.4Ashutosh Jindal中的行为与我相同:似乎只有当文件保存为.jspxYup时,问题才会出现。我尝试的文件是.jspx。也许我在IntelliJ 13中修复了吗?我喜欢你总是发现我的问题。对best IDE的强大支持:)此设置只是一个解决方法,它是。好的,谢谢。我误解了jetbrains中的对话。