public TreePath()

in model/src/main/java/jetbrains/jetpad/model/composite/TreePath.java [62:79]


  public TreePath(CompositeT from, CompositeT to) {
    CompositeT current = from;
    while (current != null && current != to) {
      CompositeT parent = current.getParent();
      if (parent != null) {
        int index = parent.children().indexOf(current);
        if (index == -1) {
          throw new IllegalStateException();
        }
        myPath.add(index);
      }
      current = parent;
    }
    if (current != to) {
      throw new IllegalStateException();
    }
    Collections.reverse(myPath);
  }