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.
Product Version: NetBeans IDE Dev (Build 200810080201) Java: 1.6.0_10-rc; Java HotSpot(TM) Client VM 11.0-b13 System: Linux version 2.6.24-19-generic running on i386; UTF-8; en_US (nb) Observed: 1, highlighting of .<%= nameOfStyle%> is incorrect 2, on this place is wrong syntax <%= style%>: <%= size%>; Steps to reproduce: Copy this source code in any .jsp file... <%@page contentType="text/html" pageEncoding="UTF-8"%> <html> <head> <% String size = "10px"; String style = "font-size"; String nameOfStyle = "test"; %> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JSP Page</title> <style> .<%= nameOfStyle%> { color: green; border: 1px; background-color: red; <%= style%>: <%= size%>; background-color: red; } h2{ azimuth: behind; border-right: blue; } </style> </head> <body> <div class="<%= nameOfStyle%>"> text in DIV </div> </body> </html>
fixed changeset: 105103:8160e6f67806 tag: tip user: Marek Fukala <mfukala@netbeans.org> date: Wed Oct 08 14:40:27 2008 +0200 summary: #149484 - Incorrect syntax highlighting and jsp parsing when I use <%= ... %> in css styles
Integrated into 'main-golden', will be available in build *200810090201* on http://bits.netbeans.org/dev/nightly/ (upload may still be in progress) Changeset: http://hg.netbeans.org/main/rev/8160e6f67806 User: Marek Fukala <mfukala@netbeans.org> Log: #149484 - Incorrect syntax highlighting and jsp parsing when I use <%= ... %> in css styles
The biggest problem was fixed, so I decrease the priority to P3. But the problem with highlighting of the line (.<%= nameOfStyle%>) is still there. In this place doesn't work code completion too. I attach screenshot of the situation.
Created attachment 71632 [details] screenshot - wrong highlighting and CC without suggest
Created attachment 71633 [details] screenshot - wrong highlighting and CC without suggest
Syntax highlighting of (.<%= nameOfStyle%>) is correct - bold green font. This is at least what we agreed on for this release. The second problem is not about css at all. The code completion in the screenshot is java completion => reassigning to Tomasz.
Here is some more information on the issue which might help. Really a PITA though :-S <%=p.|%> won't work to get code completion, but if one does <%=p!=null?"":p.|%> then code completion will work. So, it is something to do with the initial logic. So, what ever is having p!=null processed and seemingly changing state or sending something down a different logic path is working. Might help lead to your solution. Wish this was going into 6.5 :-D
The code completion in the aforementioned case with the original file works well for me. It still does not work in the following case: <%@page contentType="text/html" pageEncoding="UTF-8"%> <html> <head> <% String nameOfStyle = "test"; %> <style> .<%= nameOfSty|%> { color: green; } </style> </head> </html> where | is the caret position. If you place an extra space after the caret, it starts to work.
The Petr's case is reproducible. The java completion never works if the caret is just before the %> delimiter.
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.