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:     let trimIfNeeded (input:string) (output:string) =
          let trimLinefeed = not <|  input.EndsWith("\n")
          if trimLinefeed then output.TrimEnd('\n') 
          else input
                      
      let format (doc : Gui.Document) style formatting input options onTheFly =
          let isFsiFile = 
              if doc = null then false
              else doc.FileName.Extension.Equals(".fsi", StringComparison.OrdinalIgnoreCase)
  
          let config = getConfig style formatting
          LoggingService.LogInfo("**Fantomas**: Read config - \n{0}", sprintf "%A" config)
  
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))