@@ -31,6 +31,7 @@ open Microsoft.VisualStudio.Text.Editor
3131open System.Diagnostics
3232open System.Runtime .InteropServices
3333open System.Composition
34+ open System.ComponentModel .Composition
3435open Microsoft.CodeAnalysis .Host .Mef
3536open Microsoft.VisualStudio .Utilities
3637
@@ -129,6 +130,8 @@ type internal FSharpBraceCompletionSession
129130
130131 snapshot<-
131132use edit= subjectBuffer.CreateEdit()
133+
134+ edit.Insert( closingSnapshotPoint.Position, closingBrace.ToString()) |> ignore
132135
133136if edit.HasFailedChangesthen
134137 Debug.Fail( " Unable to insert closing brace" )
@@ -343,10 +346,8 @@ type internal ParenthesisCompletionSession () =
343346// TODO: Implement this for F#
344347true
345348
346- [<Shared>]
347349[<ExportLanguageService( typeof< IEditorBraceCompletionSessionFactory>, FSharpConstants.FSharpLanguageName) >]
348- type internal FSharpEditorBraceCompletionSessionFactory
349- [<ImportingConstructor>] (_ smartIndetationService: ISmartIndentationService, _ undoManager: ITextBufferUndoManagerProvider) =
350+ type internal FSharpEditorBraceCompletionSessionFactory () =
350351inherit ForegroundThreadAffinitizedObject()
351352
352353member __.IsSupportedOpeningBrace openingBrace =
@@ -394,7 +395,7 @@ type internal FSharpBraceCompletionSessionProvider
394395
395396let textSnapshot = openingPoint.Snapshot
396397
397- session <-
398+ let newSession =
398399match textSnapshot.GetOpenDocumentInCurrentContextWithChanges() with
399400| null -> null
400401| document->
@@ -418,6 +419,8 @@ type internal FSharpBraceCompletionSessionProvider
418419 editorOperationsFactoryService,
419420 editorSession) :> IBraceCompletionSession
420421
422+ session<- newSession
423+
421424match sessionwith
422425| null -> false
423426| _ -> true