Pantograph is a new kind of structure editor where you directly edit a typed program. In order to accomplish this, it introduces a new kind of selection -- tree selection -- and a automatic typed refactoring system.
The link is the Pantograph tutorial. Follow the [about] link from the tutorial for more information on Pantograph's implementation and published formalization.