Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 320861

Summary: JSP EL can not be parsed correctly during editing in JSP editor
Product: [WebTools] WTP Source Editing Reporter: Jack Liu <ljfeng1002>
Component: jst.jspAssignee: Rakesh <rakes123>
Status: RESOLVED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3 CC: nsand.dev, rakes123, thatnitind
Version: 3.2Flags: nsand.dev: review+
Target Milestone: 3.2.4   
Hardware: PC   
OS: Windows XP   
Whiteboard:
Attachments:
Description Flags
patch nsand.dev: iplog+

Description Jack Liu CLA 2010-07-26 01:07:39 EDT
Build Identifier: 20100617-1415

Code like:
<button>
${<cursor position>} //EL region
</button>
When removing '}' and adding '}' again, the EL region can not be recognized correctly.

In this way, the region type is JSP EL

Then follow this way:
1. Remove the "}"
It is not a valid EL region.
the type would be xml_content

2. Add the "}" again
It is a valid EL region.
but the type would still be xml_content, instead of JSP EL

It will cause the different proposals for same jsp content.

The reason is that parser will only update the xml Content region's start and length, instead of creating a new JSP EL region.

Reproducible: Always

Steps to Reproduce:
1. Code like:
<button>
${<cursor position>} //EL region
</button>

2.Remove the "}"
It is not a valid EL region.
the type would be xml_content

3.Add the "}" again
It is a valid EL region.
but the type would still be xml_content, instead of JSP EL


It will cause the different proposals for same jsp content.

The reason is that parser will only update the xml Content region's start and length, instead of creating a new JSP EL region.
Comment 1 Rakesh CLA 2010-07-27 05:24:21 EDT
Created attachment 175297 [details]
patch

This is a more general problem.As soon as EL region is destroyed either by deleting '}' or '${', it is will not be reparsed correctly even if we correct EL region.I have done changes which will reparse whole document if EL region is destroyed or corrected.It will cause more-than-needed reparsing in some of the cases.
Comment 2 Nick Sandonato CLA 2011-04-13 14:53:48 EDT
Code checked in. Thanks, Rakesh.