User Tools

Site Tools


xtext_node_position

Xtext Node Position

The model classes don't contain any information about their position in the source code. This can be retrieved with the org.eclipse.xtext.nodemodel.util.NodeModelUtils class.

var node = NodeModelUtils.getNode(modelObject);
System.out.println("Offsets: " + node.offset + " - " + node.endOffset);
System.out.println("Length: " + node.length);
xtext_node_position.txt · Last modified: 2015/08/31 16:15 by mihael