Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit93c1a5f

Browse files
committed
Automatic completion for parenthesis works
1 parent685d2d8 commit93c1a5f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

‎vsintegration/src/FSharp.Editor/AutomaticCompletion/BraceCompletionSessionProvider.fs‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ open Microsoft.VisualStudio.Text.Editor
3131
openSystem.Diagnostics
3232
openSystem.Runtime.InteropServices
3333
openSystem.Composition
34+
openSystem.ComponentModel.Composition
3435
openMicrosoft.CodeAnalysis.Host.Mef
3536
openMicrosoft.VisualStudio.Utilities
3637

@@ -129,6 +130,8 @@ type internal FSharpBraceCompletionSession
129130

130131
snapshot<-
131132
use edit= subjectBuffer.CreateEdit()
133+
134+
edit.Insert(closingSnapshotPoint.Position, closingBrace.ToString())|> ignore
132135

133136
if edit.HasFailedChangesthen
134137
Debug.Fail("Unable to insert closing brace")
@@ -343,10 +346,8 @@ type internal ParenthesisCompletionSession () =
343346
// TODO: Implement this for F#
344347
true
345348

346-
[<Shared>]
347349
[<ExportLanguageService(typeof<IEditorBraceCompletionSessionFactory>, FSharpConstants.FSharpLanguageName)>]
348-
typeinternalFSharpEditorBraceCompletionSessionFactory
349-
[<ImportingConstructor>](_smartIndetationService: ISmartIndentationService,_undoManager: ITextBufferUndoManagerProvider)=
350+
typeinternalFSharpEditorBraceCompletionSessionFactory()=
350351
inherit ForegroundThreadAffinitizedObject()
351352

352353
member__.IsSupportedOpeningBrace openingBrace=
@@ -394,7 +395,7 @@ type internal FSharpBraceCompletionSessionProvider
394395

395396
lettextSnapshot= openingPoint.Snapshot
396397

397-
session<-
398+
letnewSession=
398399
match 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+
421424
match sessionwith
422425
|null->false
423426
|_->true

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp