anchor.diff:  open Microsoft.FSharp.Compiler.Ast
   open FSharpRefactor.Engine.Ast
   open FSharpRefactor.Engine.CodeAnalysis
  +open FSharpRefactor.Engine.CodeTransforms
   
   type ScopeTree =
       | Declaration of (string * range) list * ScopeTree list
       | Usage of string * range
   
  +let isDeclared (name : string) (identifiers : (string * range) list) =
  +    List.exists (fun (n,_) -> n = name) identifiers
  +
  +let rangeOfIdent (name : string) (identifiers : (string * range) list) =
  +    let identifier = List.tryFind (fun (n,_) -> n = name) identifiers
  +    if Option.isNone identifier then None else Some(snd identifier.Value)
  +    
   let rec getDeclarations p =
       match p with
           | CodeAnalysis.Declaration(text, range) -> [(text, range)]
  
positive.code:     let rec isFree (onDeclarationFun : ScopeTree -> bool) targetName tree =
          match tree with
              | Usage(n,_) -> n <> targetName
              | Declaration(vs, ts) ->
                  if List.exists (fun (n,_) -> n = targetName) vs
                  then onDeclarationFun (Declaration(vs, ts))
                  else List.fold (fun state t -> state && isFree onDeclarationFun targetName t) true ts
  
      let declarationScope = findDeclarationInScopeTrees (makeScopeTree tree)
      if Option.isSome declarationScope
      then isFree (isFree (fun _ -> true) name) newName declarationScope.Value else false
  
negative.code:         match trees with
              | [] -> None
              | Usage(_,_)::ds -> findDeclarationInScopeTrees ds
              | Declaration(is, ts)::ds ->
                  let isDeclaration = (fun (n,r) -> n = name && rangeContainsRange r declarationRange)
                  if List.exists isDeclaration is then Some(Declaration(is, ts))
                  else findDeclarationInScopeTrees ds
  
      // Check if targetName is free in tree
  