This repository has been archived by the owner on Apr 21, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 96
/
ILocationInFileProvider.java
executable file
·47 lines (43 loc) · 2 KB
/
ILocationInFileProvider.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
/*******************************************************************************
* Copyright (c) 2008 itemis AG (http://www.itemis.eu) and others.
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License 2.0 which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* SPDX-License-Identifier: EPL-2.0
*
*******************************************************************************/
package org.eclipse.xtext.resource;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.xtext.util.ITextRegion;
import com.google.inject.ImplementedBy;
/**
* Delivers {@link ITextRegion}s for model elements or feature settings. The significant text is the part of the text
* identifying the element, e.g. its name, as opposed to the full region which is the full text representing the
* element.
* In addition to this service, the extension interface {@link ILocationInFileProviderExtension} allows to query
* for the region that is spanned by an {@link EObject} including its comments.
*
* @author Sven Efftinge - Initial contribution and API
* @author Jan Koehnlein - Distinguish significant and full region
*/
@ImplementedBy(DefaultLocationInFileProvider.class)
public interface ILocationInFileProvider {
/**
* @see org.eclipse.xtext.resource.ILocationInFileProviderExtension.RegionDescription#SIGNIFICANT
*/
ITextRegion getSignificantTextRegion(EObject obj);
/**
* @see org.eclipse.xtext.resource.ILocationInFileProviderExtension.RegionDescription#SIGNIFICANT
*/
ITextRegion getSignificantTextRegion(EObject owner, EStructuralFeature feature, int indexInList);
/**
* @see org.eclipse.xtext.resource.ILocationInFileProviderExtension.RegionDescription#FULL
*/
ITextRegion getFullTextRegion(EObject obj);
/**
* @see org.eclipse.xtext.resource.ILocationInFileProviderExtension.RegionDescription#FULL
*/
ITextRegion getFullTextRegion(EObject owner, EStructuralFeature feature, int indexInList);
}