Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 322719 - addAttributeNameProposals doesn't woke well for xsd:complexType
Summary: addAttributeNameProposals doesn't woke well for xsd:complexType
Status: CLOSED NOT_ECLIPSE
Alias: None
Product: WTP Source Editing
Classification: WebTools
Component: wst.xml (show other bugs)
Version: 3.2   Edit
Hardware: All All
: P3 major (vote)
Target Milestone: ---   Edit
Assignee: wst.xml CLA
QA Contact: Nitin Dahyabhai CLA
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-08-15 08:54 EDT by zhiqing CLA
Modified: 2010-08-23 00:03 EDT (History)
0 users

See Also:


Attachments
xml for the example (534 bytes, text/xml)
2010-08-15 08:56 EDT, zhiqing CLA
no flags Details
xsd for the example (1.54 KB, application/octet-stream)
2010-08-15 08:56 EDT, zhiqing CLA
no flags Details
xml for the example(when use the rules defined by the xsd correctly) (817 bytes, text/xml)
2010-08-15 09:02 EDT, zhiqing CLA
no flags Details

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