Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 349570 - [index] add extension to IResourceDescriptions for find references
Summary: [index] add extension to IResourceDescriptions for find references
Status: NEW
Alias: None
Product: TMF
Classification: Modeling
Component: Xtext Backlog (show other bugs)
Version: 2.0.1   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-16 10:49 EDT by Knut Wannheden CLA
Modified: 2012-11-21 08:40 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 Knut Wannheden CLA 2011-06-16 10:49:00 EDT
The current IResourceDescriptions interface (or ISelectable) does not offer any operations to perform a find references query. As a result clients must manually use IResourceDescriptions#getAllResourceDescriptions() and then IResourceDescription#getReferenceDescriptions() to find the desired references. This makes it difficult to provide a custom *efficient* index implementation (i.e. IResourceDescriptions or IBuilderState implementation) which doesn't keep the entire index contents in memory. Instead the index should be allowed to implement this query, so it can efficiently execute it against its internal data structure (e.g. an RDBMS).

In Xtext I see two use cases for a find references operation (with different requirements):

* IReferenceFinder#findIndexedReferences() - Here we want to find all IReferenceDescriptions with a target URI contained in a given Set<URI>. Thus something like: Iterable<IReferenceDescription> findReferencesTo(Set<URI>).
* IResourceDescription$Manager#isAffected() (through ClusteringBuilderState#queueAffectedResources()) - For all resources which the builder determines as changed (using IResourceDescription$Delta#haveEObjectDescriptionsChanged()) all affected resources are determined and queued. This is partly based on finding all resources with outgoing references to objects within the changed resources and would thus benefit from an operation like: Iterable<IResourceDescription> findReferencingResources(Set<URI>).