anchor.diff:          let closingSnapshotPoint = closingPoint.GetPoint(subjectBuffer.CurrentSnapshot)
   
           if closingSnapshotPoint.Position > 0 then
  -            let caretPos = getCaretPosition this
  -
  -            if caretPos.HasValue && not (this.HasNoForwardTyping(caretPos.Value, closingSnapshotPoint.Subtract(1))) then
  -                true
  -            else
  -                false
  +            match tryGetCaretPosition this with
  +            | Some caretPos when not (this.HasNoForwardTyping(caretPos, closingSnapshotPoint.Subtract(1))) -> true
  +            | _ -> false
           else
               false
   
  
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:     interface IBraceCompletionSessionProvider with
  
          member __.TryCreateSession(textView, openingPoint, openingBrace, closingBrace, session) =
              session <-
                  maybe {
                      let! document =       openingPoint.Snapshot.GetOpenDocumentInCurrentContextWithChanges() |> Option.ofObj
                      let! sessionFactory = tryGetLanguageService<IEditorBraceCompletionSessionFactory> document
                      let! session =        sessionFactory.TryCreateSession(document, openingPoint.Position, openingBrace, CancellationToken.None) |> Option.ofObj
  
                      let undoHistory = undoManager.GetTextBufferUndoManager(textView.TextBuffer).TextBufferUndoHistory
                      return BraceCompletionSession(
                          textView,
                          openingPoint.Snapshot.TextBuffer,
                          openingPoint, 
                          openingBrace, 
                          closingBrace, 
                          undoHistory, 
                          editorOperationsFactoryService, 
                          session) :> IBraceCompletionSession
                  }
                  |> Option.toObj
  
              match session with
              | null -> false
  