Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 311954 - [content assist] Duplicate suggestions for end close tag name and end tag
Summary: [content assist] Duplicate suggestions for end close tag name and end tag
Status: RESOLVED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.sse (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 normal (vote)
Target Milestone: 3.2.2   Edit
Assignee: Ian Tewksbury CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on: 312049
Blocks:
  Show dependency tree
 
Reported: 2010-05-06 14:42 EDT by Ian Tewksbury CLA
Modified: 2010-08-23 16:39 EDT (History)
1 user (show)

See Also:
nsand.dev: review+


Attachments
Fix Patch with JUnits (10.33 KB, patch)
2010-05-06 14:45 EDT, Ian Tewksbury CLA
no flags Details | Diff
Updated TestJSPContentAssistComputers.zip (135.57 KB, application/x-zip-compressed)
2010-05-06 14:46 EDT, Ian Tewksbury CLA
no flags Details
Fix Patch with JUnits - Update 1 (12.36 KB, patch)
2010-06-22 09:10 EDT, Ian Tewksbury CLA
nsand.dev: iplog+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ian Tewksbury CLA 2010-05-06 14:42:18 EDT
Currently there are two scenarios where both the HTMLTagsCompletionProposalComputer and LibraryTagsCompletionProposalComputer are giving suggestions thus presenting duplicate suggestions to the user.

SCENARIO 1:
<div></di|

SENARIO 2:
<div></di
|

A fix and additional JUnits is needed to prevent duplicate suggestions and regression respectivly.
Comment 1 Ian Tewksbury CLA 2010-05-06 14:45:15 EDT
Created attachment 167364 [details]
Fix Patch with JUnits

This patch fixes the two issues and adds 8 more JUnits to prevent regression in this area.

All existing JUnits pass and a smoke test of content assist passed.
Comment 2 Ian Tewksbury CLA 2010-05-06 14:46:30 EDT
Created attachment 167365 [details]
Updated TestJSPContentAssistComputers.zip

This is an updated ZIP for org.eclipse.jst.jsp.ui.tests/projecttestfiles/TestJSPContentAssistComputers.zip that is needed for the new JUnits.
Comment 3 Ian Tewksbury CLA 2010-05-07 08:46:25 EDT
Comment on attachment 167365 [details]
Updated TestJSPContentAssistComputers.zip

Because Bug 197954 also needs to update TestJSPContentAssistComputers.zip I have created Bug 312049 that has an updated ZIP that contains the needed test files for both Bug 197954 and this bug.
Comment 4 Nick Sandonato CLA 2010-05-11 14:32:25 EDT
The patch seems to be duplicating suggestions for custom tags. For example, I would see <c:if> suggested from both the JSP proposal list and the HTML proposal list.
Comment 5 Ian Tewksbury CLA 2010-06-22 09:10:17 EDT
Created attachment 172411 [details]
Fix Patch with JUnits - Update 1

The issue here is all the trickery that has to be done to separate HTML nodes from JSP nodes and it gets even more tricky when you throw XHTML in the mix.  I seem to have found a way to spruce up HTMLTagsCompletionProposalComputer#validModelQueryNode to return valid for HTML and XHTML nodes but not for JSP nodes.  Both JSP and XHTML nodes were evaluating to true because they are both instances of CMElementDeclaration.  So now instead I check for the HTML CMElementDeclarationImpl and then for XHTML case that uses the package protected *BuddySystem classes I check for the XHTML property.

I am the first to admit that the code used in all of the #validModelQueryNode is not pretty, but thats because we have 3 or 4 different modeling systems that are all used differently depending on the type of file and type of tag.  Luckily all of this "tricky" code is centralized in the various implementations of AbstractXMLModelQueryCompletionProposalComputer#validModelQueryNode.

I have smoked this with HTML, XHTML, JSP and XHTML JSP as well as adding a couple more JUnits to the mix.
Comment 6 Nick Sandonato CLA 2010-08-23 16:39:29 EDT
Code checked in.