IBraceCompletionContextProvider.TryCreateContext Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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.