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

Bug 322719

Summary: addAttributeNameProposals doesn't woke well for xsd:complexType
Product: [WebTools] WTP Source Editing Reporter: zhiqing <huangtaogold>
Component: wst.xmlAssignee: wst.xml <wst.xml-inbox>
Status: CLOSED NOT_ECLIPSE QA Contact: Nitin Dahyabhai <thatnitind>
Severity: major    
Priority: P3    
Version: 3.2   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
xml for the example
none
xsd for the example
none
xml for the example(when use the rules defined by the xsd correctly) none

Description zhiqing CLA 2010-08-15 08:54:15 EDT
Build Identifier: 20100730021206

In AbstractXMLModelQueryCompletionProposalComputer.java:
method: protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest)
and AbstractContentAssistProcessor.java
method:	protected void addAttributeNameProposals(ContentAssistRequest contentAssistRequest,CompletionProposalInvocationContext context) 

When:compute attribute proposals for xsd:complexType, it doesn't  return the right results.

For example, In my xsd (you can see the file in the attachment):
	<xsd:element name="newbook"  type="complextypeForNewBook"></xsd:element>
	<xsd:complexType name="complextypeForNewBook">
	    <xsd:sequence>
	        <xsd:element name="title" type="xsd:string" />
	        <xsd:element name="author" type="xsd:string"/>
	        <xsd:element name="price" type="xsd:integer" />
	        <xsd:element name="resume" type="xsd:string" />
	        <xsd:element name="recommendation" type="xsd:string" />
	    </xsd:sequence>
	    <xsd:attribute name="isbn2" type="xsd:string" />
    </xsd:complexType>

your xml file content: <newbook ></newbook>
when you the Hotkeys "Alt+/" after the word "newbook", it should gives us the contentAssist: "isbn2", but now it doesn't.
But it works well in the former versions, for example, in Eclipse XML Editors and Tools Version: 3.1.1.

I don't sure yet whether the problem exsits when you use the Hotkeys "Alt+/" inside the <newbook ></newbook> when computeCompletionProposals, maybe it has the same problem too.
but when I try it in this version, it doesn't work well and doen't return any assist. 
But it does return the assist in the version of 3.1.1, in this case, give me the assist such as "title","author","price","resume","recommendation" and so on.


You can see the example files in the attachment.

    

Reproducible: Always
Comment 1 zhiqing CLA 2010-08-15 08:56:14 EDT
Created attachment 176611 [details]
xml for the example
Comment 2 zhiqing CLA 2010-08-15 08:56:37 EDT
Created attachment 176612 [details]
xsd for the example
Comment 3 zhiqing CLA 2010-08-15 09:02:32 EDT
Created attachment 176613 [details]
xml for the example(when use the rules defined by the xsd  correctly)
Comment 4 zhiqing CLA 2010-08-23 00:03:13 EDT
I am sorry, it's not a bug.

In this case, I use org.eclipse.wst.common.uriresolver.resolverExtensions and org.eclipse.ecf.filetransfer.urlStreamHandlerService to extend the content assist function with my own xsd. But I found it doesn't work well in the current version,  by contrast, it works well in the formmer version.

Finnally, I found the truth is: In the current version of eclipse, the extension point: org.eclipse.ecf.filetransfer.urlStreamHandlerService doesn't work. In fact, it is beacuse it is never activated automatically when I use the extension point. So when I active it manually before my own plugin project's initialization, my own plugin's content assist begin to work well again.

Interestingly, the extension point(org.eclipse.ecf.filetransfer.urlStreamHandlerService ) need no activation in the formmer version of eclipse.