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.

Bug 149484 - java completion doesn't work just before scriptlet section closing delimiter
Summary: java completion doesn't work just before scriptlet section closing delimiter
Status: RESOLVED WONTFIX
Alias: None
Product: javaee
Classification: Unclassified
Component: JSP (show other bugs)
Version: 6.x
Hardware: All All
: P3 blocker (vote)
Assignee: issues@javaee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-10-08 11:54 UTC by Martin Fousek
Modified: 2015-09-17 13:09 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
screenshot - wrong highlighting and CC without suggest (37.24 KB, text/plain)
2008-10-13 06:29 UTC, Martin Fousek
Details
screenshot - wrong highlighting and CC without suggest (37.24 KB, image/png)
2008-10-13 06:30 UTC, Martin Fousek
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Fousek 2008-10-08 11:54:43 UTC
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>
Comment 1 Marek Fukala 2008-10-08 13:41:53 UTC
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
Comment 2 Quality Engineering 2008-10-09 05:56:32 UTC
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
Comment 3 Martin Fousek 2008-10-13 06:27:31 UTC
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.
Comment 4 Martin Fousek 2008-10-13 06:29:18 UTC
Created attachment 71632 [details]
screenshot - wrong highlighting and CC without suggest
Comment 5 Martin Fousek 2008-10-13 06:30:41 UTC
Created attachment 71633 [details]
screenshot - wrong highlighting and CC without suggest
Comment 6 Marek Fukala 2008-10-13 07:54:32 UTC
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.
Comment 7 _ wadechandler 2008-11-05 15:59:16 UTC
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
Comment 8 Petr Jiricka 2009-11-05 15:21:45 UTC
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.
Comment 9 Marek Fukala 2010-05-13 14:34:58 UTC
The Petr's case is reproducible. The java completion never works if the caret is just before the %> delimiter.
Comment 10 Martin Balin 2015-09-17 13:09:38 UTC
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.