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:         if trimLinefeed then output.TrimEnd('\n') 
          else output
                      
      let format (editor : Editor.TextEditor option) style formatting input options =
          let isFsiFile = 
              match editor with 
              | Some d -> d.FileName.Extension.Equals(".fsi", StringComparison.OrdinalIgnoreCase)
  
negative.code:                         let col = editor.CaretColumn
                          editor.ReplaceText(0, input.Length, result)
                          editor.SetCaretLocation (line, col, false))
                      StringTextSource (result)
                  with exn -> 
                      LoggingService.LogError("Error occured: {0}", exn.Message)
                      StringTextSource.Empty
              output :> ITextSource
  
          | Selection(fromOffset, toOffset) ->
              // Convert from offsets to line and column position
  