Compare tree structure when searching for changed trees.

Fixes Scala-IDE #1001769