Tree-Edit was one of the first packages to offer structural editing for non-Lisp languages via Tree-sitter. It is composed of two packages. First, a core library containing a reasoning engine built on top of tree-sitter, along with commands for structural and templated editing. And another package for an evil state that leverages these features in a user interface. The latter provides a “point-free” editing experience similar to Symex.
While there is some overlap in functionality at the UI level, the core features offered by the packages are fairly distinct, and it’s likely that they could be leveraged by either package, someday.
For instance, Symex provides a very basic set of insertion commands. “Inserting after” an if
block in Symex would just put the cursor at the right spot and leave the rest to you, but Tree-Edit would wrap the insertion point with else
! On the other hand, Symex provides a rich array of traversals via the DSL, which Tree-Edit doesn’t have today.
For most other packages on this list, it’s easy to use them together with Symex, but for Tree-Edit, as it, too, is modal, using them together may not be straightforward. It likely makes a lot more sense to integrate these packages at the library level, which we hope to explore.