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

Bug 311957

Summary: [content model] Need way for ModelQueryExtensions to make document root level contributions
Product: [WebTools] WTP Source Editing Reporter: Ian Tewksbury <itewksbu>
Component: wst.xmlAssignee: wst.xml <wst.xml-inbox>
Status: NEW --- QA Contact: Nick Sandonato <nsand.dev>
Severity: enhancement    
Priority: P3 CC: nsand.dev, valentinbaciu
Version: 3.2Flags: itewksbu: review? (keith.chong.ca)
thatnitind: review? (nsand.dev)
Target Milestone: Future   
Hardware: All   
OS: All   
Whiteboard:
Bug Depends on:    
Bug Blocks: 311959, 311961    
Attachments:
Description Flags
Enhancement Patch none

Description Ian Tewksbury CLA 2010-05-06 14:56:23 EDT
Currently the ModelQueryExtension only always an extender to make contributions to the content of elements but not to the document root level.  The scenario where this is needed is for content assist being able to suggest JSP and JSP library tags at the document root level (Bug 197954).
Comment 1 Ian Tewksbury CLA 2010-05-06 15:02:14 EDT
Created attachment 167369 [details]
Enhancement Patch

I will be the first to admit I am not overly familiar with the ModelQuery* code base but I took a stab at this anyways.  My suggested patch for allowing ModelQueryExtensions to provide document root level contributions is based on the existing functionality for allowing them to contribute to element content.  There is some validation and filtering of contributions that is done for the element content case that I did not see anyway how it would apply to the document root case, but I could very well be miss understanding the purposes of this validation and filtering.

This suggested patch passes all existing JUnits.  I would be happy to provide some new ones but not exactly sure the best way to go about testing this functionality directly.