anchor.diff:          member this.PreBackspace handledCommand =
               handledCommand <- false
   
  -            let caretPos = getCaretPosition this
  -            let snapshot = subjectBuffer.CurrentSnapshot
  -
  -            if caretPos.HasValue && caretPos.Value.Position > 0 &&
  -                    caretPos.Value.Position - 1 = openingPoint.GetPoint(snapshot).Position &&
  -                    not this.HasForwardTyping then
  +            match tryGetCaretPosition this with
  +            | Some caretPos ->
  +                let snapshot = subjectBuffer.CurrentSnapshot
  +
  +                if caretPos.Position > 0 &&
  +                        caretPos.Position - 1 = openingPoint.GetPoint(snapshot).Position &&
  +                        not this.HasForwardTyping then
                   
  -                use undo = this.CreateUndoTransaction()
  -                use edit = subjectBuffer.CreateEdit()
  -
  -                let span = SnapshotSpan(openingPoint.GetPoint(snapshot), closingPoint.GetPoint(snapshot))
  -
  -                edit.Delete(span.Span) |> ignore
  -
  -                if edit.HasFailedChanges then
  -                    edit.Cancel()
  -                    undo.Cancel()
  -                    Debug.Fail("Unable to clear braces")
  -                else
  -                    // handle the command so the backspace does 
  -                    // not go through since we've already cleared the braces
  -                    handledCommand <- true
  -                    edit.Apply() |> ignore // FIXME: ApplyAndLogExceptions()
  -                    undo.Complete()
  -                    this.EndSession()
  +                    use undo = this.CreateUndoTransaction()
  +                    use edit = subjectBuffer.CreateEdit()
  +
  +                    let span = SnapshotSpan(openingPoint.GetPoint(snapshot), closingPoint.GetPoint(snapshot))
  +
  +                    edit.Delete(span.Span) |> ignore
  +
  +                    if edit.HasFailedChanges then
  +                        edit.Cancel()
  +                        undo.Cancel()
  +                        Debug.Fail("Unable to clear braces")
  +                    else
  +                        // handle the command so the backspace does 
  +                        // not go through since we've already cleared the braces
  +                        handledCommand <- true
  +                        edit.Apply() |> ignore // FIXME: ApplyAndLogExceptions()
  +                        undo.Complete()
  +                        this.EndSession()
  +            | _ -> ()
              
           member __.PostBackspace() = ()
   
  
positive.code: [<AutoOpen>]
  module BraceCompletionSessionProviderHelpers =
  
      let getLanguageService<'T when 'T :> ILanguageService and 'T : null> (document: Document) =
          match document.Project with
          | null -> null
          | project ->
              match project.LanguageServices with
              | null -> null
              | languageServices ->
                  languageServices.GetService<'T>()
  
      let getCaretPoint (buffer: ITextBuffer) (session: IBraceCompletionSession) =
          session.TextView.Caret.Position.Point.GetPoint(buffer, PositionAffinity.Predecessor)
  
      let getCaretPosition session =
          session |> getCaretPoint session.SubjectBuffer
  
      let tryInsertAdditionalBracePair (session: IBraceCompletionSession) openingChar closingChar =
          let sourceCode = session.TextView.TextSnapshot
  
negative.code: 
                  let closingSnapshotPoint = closingPoint.GetPoint(snapshot)
                  if not this.HasForwardTyping && session.AllowOverType(this, cancellationToken) then
                      let caretPosOpt = tryGetCaretPosition this
  
                      Debug.Assert(caretPosOpt.IsSome && caretPosOpt.Value.Position < closingSnapshotPoint.Position)
  
                      match caretPosOpt with
                      // ensure that we are within the session before clearing
                      | Some caretPos when caretPos.Position < closingSnapshotPoint.Position && closingSnapshotPoint.Position > 0 ->
                          use undo = this.CreateUndoTransaction()
  
                          let span = SnapshotSpan(caretPos, closingSnapshotPoint.Subtract(1))
  
                          use edit = subjectBuffer.CreateEdit()
  
  