User Tools

Site Tools


xtext_node_position

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

xtext_node_position [2015/08/31 16:15] (current)
mihael created
Line 1: Line 1:
 +====== 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);​
 +  ​
 +{{tag>​java xtext}}
xtext_node_position.txt ยท Last modified: 2015/08/31 16:15 by mihael