anchor.diff:      override x.CorrectIndenting(policyParent, mimeTypeChain, data, line) = raise (NotSupportedException())
   
       override x.OnTheFlyFormat(doc, fromOffset, toOffset) =
  -        let doc = IdeApp.Workbench.ActiveDocument
           let policyParent : PolicyContainer =
               match doc.Project with
               | null -> PolicyService.DefaultPolicies
  
positive.code:             | Some newCode -> newCode
              | None -> null
  
      let formatText (doc : Gui.Document) (policyParent : PolicyContainer) (mimeTypeInheritanceChain : string seq) input formattingOption = 
          let textStylePolicy = policyParent.Get<TextStylePolicy>(mimeTypeInheritanceChain)
          let formattingPolicy = policyParent.Get<FSharpFormattingPolicy>(mimeTypeInheritanceChain)
          format doc textStylePolicy formattingPolicy input formattingOption
  
negative.code:         let input = doc.Editor.Text
          if fromOffset = 0 && toOffset = String.length input then 
              LoggingService.LogInfo("**Fantomas**: OnTheFly Formatting document")
              formatText (Some doc) policyParent mimeTypeChain input Document
              |> ignore
          else 
              LoggingService.LogInfo("**Fantomas**: OnTheFly Formatting selection")
              formatText (Some doc) policyParent mimeTypeChain input (Selection(fromOffset, toOffset))
              |> ignore
  
      override x.FormatText(policyParent, mimeTypeChain, input, fromOffset, toOffset) = 
          if fromOffset = 0 && toOffset = String.length input then 
              LoggingService.LogInfo("**Fantomas**: Formatting document")
              formatText None policyParent mimeTypeChain input Document
          else 
              LoggingService.LogInfo("**Fantomas**: Formatting selection")
              formatText None policyParent mimeTypeChain input (Selection(fromOffset, toOffset))