Search in sources :

Example 6 with LocationData

use of org.eclipse.xtext.generator.trace.LocationData in project xtext-core by eclipse.

the class TracingSugar method location.

/**
 * @return ILocationData covering the <code>fullTextRegion</code> of the given EObject.
 */
public ILocationData location(EObject obj) {
    ITextRegion region = locationProvider.getFullTextRegion(obj);
    SourceRelativeURI uri = traceURIConverter.getURIForTrace(obj.eResource());
    return new LocationData((ITextRegionWithLineInformation) region, uri);
}
Also used : LocationData(org.eclipse.xtext.generator.trace.LocationData) ILocationData(org.eclipse.xtext.generator.trace.ILocationData) ITextRegion(org.eclipse.xtext.util.ITextRegion) SourceRelativeURI(org.eclipse.xtext.generator.trace.SourceRelativeURI)

Aggregations

LocationData (org.eclipse.xtext.generator.trace.LocationData)6 Test (org.junit.Test)4 StringConcatenation (org.eclipse.xtend2.lib.StringConcatenation)3 ILocationData (org.eclipse.xtext.generator.trace.ILocationData)2 SourceRelativeURI (org.eclipse.xtext.generator.trace.SourceRelativeURI)2 ITextRegion (org.eclipse.xtext.util.ITextRegion)2 StringConcatenationClient (org.eclipse.xtend2.lib.StringConcatenationClient)1