static Tree.CompilationUnit getRootNode(PhasedUnit unit) {
   IEditorPart ce = getCurrentEditor();
   if (ce instanceof CeylonEditor) {
     CeylonEditor editor = (CeylonEditor) ce;
     CeylonParseController cpc = editor.getParseController();
     if (cpc != null) {
       Tree.CompilationUnit rn = cpc.getTypecheckedRootNode();
       if (rn != null) {
         Unit u = rn.getUnit();
         if (u.equals(unit.getUnit())) {
           return rn;
         }
       }
     }
   }
   return unit.getCompilationUnit();
 }