anchor.diff:                               None
                       return result }
   
  -            match tryFormat with
  -            | Some newCode -> newCode
  -            | None -> null
  +            let formatted =
  +                match tryFormat with
  +                | Some newCode -> StringTextSource (newCode)
  +                | None -> StringTextSource.Empty
  +            formatted :> ITextSource
   
  -    let formatText (editor : Editor.TextEditor option) (policyParent : PolicyContainer) (mimeTypeInheritanceChain : string seq) input formattingOption = 
  -        let textStylePolicy = policyParent.Get<TextStylePolicy>(mimeTypeInheritanceChain)
  -        let formattingPolicy = policyParent.Get<FSharpFormattingPolicy>(mimeTypeInheritanceChain)
  +    let formatText (editor : Editor.TextEditor option) (policyParent : PolicyContainer) (mimeType:string) input formattingOption = 
  +        let textStylePolicy = policyParent.Get<TextStylePolicy>(mimeType)
  +        let formattingPolicy = policyParent.Get<FSharpFormattingPolicy>(mimeType)
           format editor textStylePolicy formattingPolicy input formattingOption
   
       static member MimeType = "text/x-fsharp"
   
       override x.SupportsOnTheFlyFormatting = true
       override x.SupportsCorrectingIndent = false
  -    override x.CorrectIndenting(_policyParent, _mimeTypeChain, _data, _line) = raise (NotSupportedException())
   
  -    override x.OnTheFlyFormat(editor, context, fromOffset, toOffset) =
  +    override x.OnTheFlyFormatImplementation(editor, context, fromOffset, toOffset) =
           let policyParent : PolicyContainer =
               match context.Project with
               | null -> PolicyService.DefaultPolicies
  
positive.code:             match project.Policies with 
              | null -> PolicyService.DefaultPolicies
              | policyBag -> policyBag  :> PolicyContainer
  
          let mimeTypeChain = DesktopService.GetMimeTypeInheritanceChain (FSharpFormatter.MimeType)
          let input = editor.Text
          if fromOffset = 0 && toOffset = String.length input then 
              formatText (Some editor) policyParent mimeTypeChain input Document
              |> ignore
          else 
              formatText (Some editor) policyParent mimeTypeChain input (Selection(fromOffset, toOffset))
              |> ignore
  
      override x.FormatText(policyParent, mimeTypeChain, input, fromOffset, toOffset) = 
          if fromOffset = 0 && toOffset = String.length input then 
              formatText None policyParent mimeTypeChain input Document
          else 
              formatText None policyParent mimeTypeChain input (Selection(fromOffset, toOffset))
negative.code:         if trimLinefeed then output.TrimEnd('\n') 
          else output
                      
      let format (editor : Editor.TextEditor option) style formatting input options : ITextSource =
          let isFsiFile = 
              match editor with 
              | Some d -> d.FileName.Extension.Equals(".fsi", StringComparison.OrdinalIgnoreCase)
  