Reformat JSP

Something strange appears to happening with jsp file in #7291.
Ctrl-Alt-L doesn't appeat to reformat the code.
However, if I press return after a tag the next line is indented properly and if I press return before a tag, that line is indented properly.

So the reformat code appears to be there, but not implemented as Ctrl-Alt-L

Is that right?

2 comments

Hello opticyclic,

That's not right, but CtrlAltL works for me in 7291 and 7334.

Something strange appears to happening with jsp file in #7291.

Ctrl-Alt-L doesn't appeat to reformat the code.

However, if I press return after a tag the next line is indented
properly and if I press return before a tag, that line is indented
properly.

So the reformat code appears to be there, but not implemented as
Ctrl-Alt-L

Is that right?

Alexander.


0

JSP formatter sometimes chokes on particular JSP files. I bet the problem isn't happening on all your JSPs. One known problem I know is that if you have java code inside a script tag, the formatter is broken. (http://www.jetbrains.net/jira/browse/IDEADEV-6433)

The JSP formatter is a nightmare. I stopped using it because of bugs and also lack of control over how the java code is formatted/indented.

I wrote up a Jira (http://www.jetbrains.net/jira/browse/IDEABKL-4691) a long time ago, and I still think we need separate formatting options for JSP to make JSP format usable.

I have been coding/modifying lots of JSPs the past month, and I just avoid formatting the whole file. The most I will do is highlight a block of java code and then reformat that since the java formatter still works OK if it is pure java.

If you can isolate the problem, please file a Jira.

0

Please sign in to leave a comment.