This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.
use scriptlet defined using JSP tags: -------------------- <jsp:scriptlet> int i = 0; int j = 10; </jsp:scriptlet> -------------------- press Enter enywhere inside scriptlet - cursor is always moved at the begging of a line and it's not indented at all reformatting works well, indenation works well in scriptlets defined using <% ... %> the same problem si for <jsp:expression> and <jsp:declaration>
The lexical content of the <jsp:scritlet> area and <% %> is the same, other features works. Seems to be indentation issue.
Marek, code handling this involves JspSyntaxSupport which I know very little about. Placing some code dumps I can see that given code example is translated into following TokenIDs: '<', tokenID=symbol, tcp=|<JspTagTokenContext><JspMultiTokenContext>|, offset=0 '\n int i = 0;\n int j = 10;\n', tokenID=text, tcp=|<HtmlTokenContext><JspMultiTokenContext>|, offset=15 '>', tokenID=symbol, tcp=|<JspTagTokenContext><JspMultiTokenContext>|, offset=14 '</', tokenID=symbol, tcp=|<JspTagTokenContext><JspMultiTokenContext>|, offset=63 '\n', tokenID=text, tcp=|<HtmlTokenContext><JspMultiTokenContext>|, offset=79 '>', tokenID=symbol, tcp=|<JspTagTokenContext><JspMultiTokenContext>|, offset=78 what? where? and how is this done??? Problem is that Java code is not properly identified and is treated as HTML. (if I understand it well)
If you depend on JspSyntaxSupport you are out of luck. The JSPSS is built on top of old syntax (predecessor of lexer). This old syntax (see JspMultiSyntax class in o.n.m.web.core.syntax.deprecated) doesn't recognize the <jsp:scriptlet> sections as java code so the content appears as html text. These classes are already replaced by the jsp lexer, but some parts of the jsp code still depends on them. I won't definitely do any fix in the old syntax classes, I hope that if I did the jsp module migration to parsing.api in next version I would also get rid of the JspSyntaxSupport and all deprecated classes. So for now I recommend to put this off to the next release, or you can migrate the code so it doesn't depend on JspSyntaxSupport but directly on jsp lexer (which shouldn't be that big deal)
The source of problem is there is no formatter for Java embedded in JSP and so old org.netbeans.editor.ext.java.JavaFormatter using JspSyntaxSupport must be still used. Sounds like this never worked before so I'm lowering priority.
Not doable for 6.8 based on the comments above. For the purpose of next releases planning, is it enough if we do these changes in the JSP editor side? Or are there changes on the Java side required too?
(In reply to comment #5) > Not doable for 6.8 based on the comments above. For the purpose of next > releases planning, is it enough if we do these > changes in the JSP editor side? Or are there changes on the Java side required > too? I think it needs to be fixed on Java side first.
Report from old NetBeans version. Due to code changes since it was reported likely not reproducible now. Feel free to reopen if happens in 8.0.2 or 8.1.