if (needsDebugData) {
Nodes.setFilePositionFor(
node, FilePosition.span(Nodes.getFilePositionFor(node), endPos));
if (openNodes.size() == 1) {
FilePosition rootPos = Nodes.getFilePositionFor(rootElement);
if (rootPos.endCharInFile() <= 1) {
rootPos = Nodes.getFilePositionFor(rootElement.getFirstChild());
}
if (rootPos.startCharInFile() <= endPos.startCharInFile()) {
Nodes.setFilePositionFor(
rootElement, FilePosition.span(rootPos, endPos));