org.eclipse.xtext.resource
Interface ILocationInFileProviderExtension

All Known Implementing Classes:
DefaultLocationInFileProvider, JvmLocationInFileProvider, XbaseLocationInFileProvider, XtendLocationInFileProvider, XtextLocationInFileProvider

@NonNullByDefault
public interface ILocationInFileProviderExtension

Extends the functionality of the ILocationInFileProvider to allow clients to query for a region with more fine grained criteria.

Since:
2.3
Author:
Sebastian Zarnekow - Initial contribution and API

Nested Class Summary
static class ILocationInFileProviderExtension.RegionDescription
          Describes the kind of region that is queried.
 
Method Summary
 ITextRegion getTextRegion(org.eclipse.emf.ecore.EObject object, org.eclipse.emf.ecore.EStructuralFeature feature, int indexInList, ILocationInFileProviderExtension.RegionDescription query)
          Queries for parts of the text region that parts of the given object originate from.
 ITextRegion getTextRegion(org.eclipse.emf.ecore.EObject object, ILocationInFileProviderExtension.RegionDescription query)
          Queries for parts of the text region that the given object is originates from.
 

Method Detail

getTextRegion

@Nullable
ITextRegion getTextRegion(org.eclipse.emf.ecore.EObject object,
                                   ILocationInFileProviderExtension.RegionDescription query)
Queries for parts of the text region that the given object is originates from.

Parameters:
object - the instance whose region should be returned.
query - the hint about the requested range.
Returns:
the text region or null if the object does not have an associated text region.

getTextRegion

@Nullable
ITextRegion getTextRegion(org.eclipse.emf.ecore.EObject object,
                                   org.eclipse.emf.ecore.EStructuralFeature feature,
                                   int indexInList,
                                   ILocationInFileProviderExtension.RegionDescription query)
Queries for parts of the text region that parts of the given object originate from.

Parameters:
object - the instance whose region should be returned.
feature - the feature that was set when the requested range was consumed by the parser.
indexInList - the index in the list of feature values. -1 if all values should be considered.
query - the hint about the requested range.
Returns:
the text region or null if the object does not have an associated text region.