| Summary: | [content assist] Duplicate suggestions for end close tag name and end tag | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | [WebTools] WTP Source Editing | Reporter: | Ian Tewksbury <itewksbu> | ||||||||
| Component: | wst.sse | Assignee: | Ian Tewksbury <itewksbu> | ||||||||
| Status: | RESOLVED FIXED | QA Contact: | Nitin Dahyabhai <thatnitind> | ||||||||
| Severity: | normal | ||||||||||
| Priority: | P3 | CC: | nsand.dev | ||||||||
| Version: | 3.2 | Flags: | nsand.dev:
review+
|
||||||||
| Target Milestone: | 3.2.2 | ||||||||||
| Hardware: | All | ||||||||||
| OS: | All | ||||||||||
| Whiteboard: | |||||||||||
| Bug Depends on: | 312049 | ||||||||||
| Bug Blocks: | |||||||||||
| Attachments: |
|
||||||||||
|
Description
Ian Tewksbury
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.
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 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. 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. 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.
Code checked in. |