Package org.eclipse.handly.model
Interface ISourceElementExtension
- All Superinterfaces:
IElement,ISourceElement
Model implementors may opt to extend this interface, which extends
ISourceElement with a number of default methods.
This interface is not intended to be referenced for purposes other than extension.
-
Method Summary
Modifier and TypeMethodDescriptiondefault ISourceElementgetSourceElementAt(int position, ISnapshot base) Returns the smallest element within this element that includes the given source position, ornullif the given position is not within the source range of this element.default ISourceElementInfoReturns an object holding cached structure and properties for this element.
-
Method Details
-
getSourceElementAt
default ISourceElement getSourceElementAt(int position, ISnapshot base) throws org.eclipse.core.runtime.CoreException Returns the smallest element within this element that includes the given source position, ornullif the given position is not within the source range of this element. If no finer grained element is found at the position, this element itself is returned.- Parameters:
position- a source position (0-based)base- a snapshot on which the given position is based, ornullif the snapshot is unknown or does not matter- Returns:
- the innermost element enclosing the given source position,
or
nullif none (including this element itself) - Throws:
org.eclipse.core.runtime.CoreException- if this element does not exist or if an exception occurs while accessing its corresponding resourceStaleSnapshotException- if snapshot inconsistency is detected, i.e., this element's current structure and properties are based on a different snapshot
-
getSourceElementInfo
Returns an object holding cached structure and properties for this element.- Returns:
- an
ISourceElementInfofor this element (nevernull) - Throws:
org.eclipse.core.runtime.CoreException- if this element does not exist or if an exception occurs while accessing its corresponding resource
-