Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 338025 - Not all attribute proposals are being returned
Summary: Not all attribute proposals are being returned
Status: VERIFIED FIXED
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: 3.3   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 3.3 M6   Edit
Assignee: Nitin Dahyabhai CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-23 16:43 EST by David Carver CLA
Modified: 2011-02-24 09:33 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.