Could someone from Adobe verify that this code properly computes the edit context root, given a selection?
It’s very simple and to the point, I hope. It works by running through the selection, and finding the lowest-common-ancester at each point, with the special case of an artboard result being promoted to root.
I’m using this in my Layers for Developers plugin–plug: it’s an invaluable, free tool for all devs, and I’d love you to try it out–to show the current edit context root, and I don’t want to mislead people. Thus my request for verification.