IBraceCompletionContextProvider.TryCreateContext 方法

定义

创建一个 IBraceCompletionContext 以处理特定于语言的操作,如分析和格式设置。

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

参数

textView
ITextView

包含的视图 openingPoint

openingPoint
SnapshotPoint

的插入点 openingBrace

openingBrace
Char

左大括号,已由用户键入。

closingBrace
Char

右大括号字符

context
IBraceCompletionContext

如果已创建,则为大括号完成上下文。

返回

Boolean

如果 openingPoint 是要启动的缓冲区中的有效点,则返回 true IBraceCompletionSession

注解

字符串和注释中的打开点通常无效,无法启动 IBraceCompletionSession ,并且将返回 false。

适用于