Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 368348

Summary: [Xtext] org.eclipse.xtext.resource.EObjectAtOffsetHelper.resolveElementAt(XtextResource, int) should return the contained element
Product: [Modeling] TMF Reporter: Holger Schill <Holger.Schill>
Component: XtextAssignee: Holger Schill <Holger.Schill>
Status: CLOSED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: sebastian.zarnekow
Version: unspecifiedFlags: sebastian.zarnekow: juno+
Target Milestone: M5   
Hardware: PC   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:

Description Holger Schill CLA 2012-01-11 09:26:50 EST
The method org.eclipse.xtext.resource.EObjectAtOffsetHelper.resolveElementAt(XtextResource, int) returns the same as org.eclipse.xtext.resource.EObjectAtOffsetHelper.resolveCrossReferencedElementAt(XtextResource, int).

To get the element at a special offset that points to a crossreference you have to take the AST and use org.eclipse.xtext.nodemodel.util.NodeModelUtils.findActualSemanticObjectFor(INode).

Maybe we should add a new method that does exactly that.
Comment 1 Holger Schill CLA 2012-01-11 09:48:01 EST
We have to fix org.eclipse.xtext.resource.EObjectAtOffsetHelper.internalResolveElementAt(XtextResource, int, boolean) at add a javaDoc to org.eclipse.xtext.resource.EObjectAtOffsetHelper.resolveElementAt(XtextResource,
int) that this method returns the contained element.
Comment 2 Holger Schill CLA 2012-01-11 10:20:06 EST
pushed to master.
Comment 3 Karsten Thoms CLA 2017-09-19 17:04:34 EDT
Closing all bugs that were set to RESOLVED before Neon.0
Comment 4 Karsten Thoms CLA 2017-09-19 17:16:31 EDT
Closing all bugs that were set to RESOLVED before Neon.0