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

Bug 338025

Summary: Not all attribute proposals are being returned
Product: [WebTools] WTP Source Editing Reporter: David Carver <d_a_carver>
Component: wst.xmlAssignee: Nitin Dahyabhai <thatnitind>
Status: VERIFIED FIXED QA Contact: Nitin Dahyabhai <thatnitind>
Severity: normal    
Priority: P3    
Version: 3.3   
Target Milestone: 3.3 M6   
Hardware: PC   
OS: Linux   
Whiteboard:

Description David Carver CLA 2011-02-23 16:43:21 EST
I've tracked this down at least in the old XMLContentAssistProcessor around line 184, to the following bit of code:

					boolean showAttribute = true;
					showAttribute = showAttribute && beginsWith(getRequiredName(node, attrDecl), matchString.trim());
					AttrImpl attr = (AttrImpl) node.getAttributes().getNamedItem(getRequiredName(node, attrDecl));
					ITextRegion nameRegion = attr != null ? attr.getNameRegion() : null;
					// nameRegion.getEndOffset() + 1 is required to allow for
					// matches against the full name of an existing Attr
					showAttribute -s= showAttribute && ((attr == null) || ((nameRegion != null) && (sdRegion.getStartOffset(nameRegion) <= contentAssistRequest.getReplacementBeginPosition()) && (sdRegion.getStartOffset(nameRegion) + nameRegion.getLength() >= contentAssistRequest.getReplacementBeginPosition() + contentAssistRequest.getReplacementLength())));

The file in the xsl tools UI test, called simple.xsl can be used to reproduce the problem in the normal XML editor.

Load the file up.

Locate the line <xsl:value-of select="" />

Position the cursor right before the />

Press CTRL + SPACE

You do not get the disable-output-escaping attribute in the proposals list.

If you open the Content Model View, and expand out the value-of element. You will see that you should have two choices.

select
disable-output-escaping.

This is a regression possibly due to the way default values are now being handled for attributes.
Comment 1 Nitin Dahyabhai CLA 2011-02-23 22:03:32 EST
Corrected.
Comment 2 David Carver CLA 2011-02-24 09:33:22 EST
Verified that the latest changes make this work. XSL test that was failing now passes.