private void addRemoval(Tree.Identifier id, Declaration d) {
   if (id != null
       && d != null
       && dec.equals(getAbstraction(d))
       && id.getText().equals(aid.getText())) {
     change.addEdit(new ReplaceEdit(id.getStartIndex(), id.getDistance(), dec.getName()));
   }
 }
 protected void renameIdentifier(TextChange tfc, Tree.Identifier id, Tree.CompilationUnit root) {
   String name = declaration.getName();
   int loc = id.getText().indexOf(name);
   int start = id.getStartIndex();
   int len = id.getDistance();
   if (loc > 0) {
     tfc.addEdit(new ReplaceEdit(start + loc, name.length(), newName));
   } else {
     tfc.addEdit(new ReplaceEdit(start, len, escaping_.get_().toInitialLowercase(newName)));
   }
 }
 static void addRemoveAliasProposal(
     Tree.ImportMemberOrType imt,
     Collection<ICompletionProposal> proposals,
     IFile file,
     CeylonEditor editor) {
   if (imt != null) {
     Declaration dec = imt.getDeclarationModel();
     Tree.CompilationUnit upToDateAndTypechecked =
         editor.getParseController().getTypecheckedRootNode();
     if (dec != null && imt.getAlias() != null && upToDateAndTypechecked != null) {
       TextFileChange change = new TextFileChange("Remove Alias", file);
       change.setEdit(new MultiTextEdit());
       Tree.Identifier aid = imt.getAlias().getIdentifier();
       change.addEdit(
           new DeleteEdit(
               aid.getStartIndex(), imt.getIdentifier().getStartIndex() - aid.getStartIndex()));
       upToDateAndTypechecked.visit(new AliasRemovalVisitor(dec, change, aid));
       proposals.add(new RemoveAliasProposal(file, dec, change));
     }
   }
 }