Share via


IBraceCompletionContextProvider.TryCreateContext Method

Definition

Creates an IBraceCompletionContext to handle language-specific actions such as parsing and formatting.

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

Parameters

textView
ITextView

View containing the openingPoint.

openingPoint
SnapshotPoint

Insertion point of the openingBrace.

openingBrace
Char

Opening brace that has been typed by the user.

closingBrace
Char

Closing brace character

context
IBraceCompletionContext

Brace completion context 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