Partager via


IBraceCompletionSessionProvider.TryCreateSession Method

Definition

If appropriate, creates an IBraceCompletionSession based on the language context at the openingPoint.

public:
 bool TryCreateSession(Microsoft::VisualStudio::Text::Editor::ITextView ^ textView, Microsoft::VisualStudio::Text::SnapshotPoint openingPoint, char openingBrace, char closingBrace, [Runtime::InteropServices::Out] Microsoft::VisualStudio::Text::BraceCompletion::IBraceCompletionSession ^ % session);
public bool TryCreateSession (Microsoft.VisualStudio.Text.Editor.ITextView textView, Microsoft.VisualStudio.Text.SnapshotPoint openingPoint, char openingBrace, char closingBrace, out Microsoft.VisualStudio.Text.BraceCompletion.IBraceCompletionSession session);
abstract member TryCreateSession : Microsoft.VisualStudio.Text.Editor.ITextView * Microsoft.VisualStudio.Text.SnapshotPoint * char * char * IBraceCompletionSession -> bool
Public Function TryCreateSession (textView As ITextView, openingPoint As SnapshotPoint, openingBrace As Char, closingBrace As Char, ByRef session As IBraceCompletionSession) As Boolean

Parameters

textView
ITextView

View containing the openingPoint.

openingPoint
SnapshotPoint

Insertion point of the openingBrace within the subject buffer. The content type of the subject buffer will match one of the [ContentType] attributes for this extension.

openingBrace
Char

Opening brace that has been typed by the user.

closingBrace
Char

Closing brace character

session
IBraceCompletionSession

Brace completion session if created.

Returns

Returns true if the openingPoint was a valid point in the buffer to start a IBraceCompletionSession.

Remarks

Opening points within strings and comments are usually invalid points to start an IBraceCompletionSession and will return false.

Applies to