debugGetDiagnosticChain method

List<Element> debugGetDiagnosticChain ()

Returns the parent chain from this element back to the root of the tree.

Useful for debug display of a tree of Elements with only nodes in the path from the root to this Element expanded.


List<Element> debugGetDiagnosticChain() {
  final List<Element> chain = <Element>[this];
  Element node = _parent;
  while (node != null) {
    node = node._parent;
  return chain;