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

Bug 313735

Summary: Types from the schemas in the project are shown twice in the type selection dialog
Product: [WebTools] WTP Source Editing Reporter: Stanislav Nichev <stanislav.nichev>
Component: wst.xsdAssignee: wst.xsd-triaged <wst.xsd-triaged>
Status: NEW --- QA Contact: Keith Chong <keith.chong.ca>
Severity: normal    
Priority: P3 CC: keith.chong.ca
Version: 3.1   
Target Milestone: Future   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Stanislav Nichev CLA 2010-05-20 10:25:43 EDT
Build Identifier: 3.5.2.R35x_v20100119-7Q7bARBPWUHM_CSjz-8bF1f7_n8rLSyWHoiKoyxBQSGT4

In the set element type selection dialog, the XML schema types are shown twice - once from the source folder and once from the project output directory.

Reproducible: Always

Steps to Reproduce:
TC #1:
1. Create new XML schema somewhere in the source folder of a java project
2. Open the created schema in the XML Schema Editor
3. Add new structure type
4. Save the document
5. Add element
6. Right click on the created element -> Set Type -> Browse...
7. Select the "Eclosing Project" radio button from the "Search Scope" section
8. In the types list, you should see the created in step 3 structure type twice

TC #2:
1. Create new XML schema somewhere in the source folder of a java project
2. Open the created schema in the XML Schema Editor
3. Add new structure type
4. Save the document
5. Create new XML schema file and open it in the XML Schema Editor
6. Add element
7. Right click on the created element -> Set Type -> Browse...
8. Select the "Eclosing Project" radio button from the "Search Scope" section
9. In the types list, you should see the created in step 3 structure type twice
Comment 1 Valentin Baciu CLA 2010-07-20 15:33:50 EDT
Yes, the wst.common search infrastructure seems to search even in derived files. Should be relatively easy to fix, perhaps somewhere in org.eclipse.wst.common.core.search.scope.SearchScopeImpl.traverseContainer(IContainer) by checking the result of IResource#isDerived.