IBraceCompletionContextProvider.TryCreateContext 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
创建一个 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
如果已创建,则为大括号完成上下文。
返回
如果 openingPoint 是要启动的缓冲区中的有效点,则返回 true IBraceCompletionSession 。
注解
字符串和注释中的打开点通常无效,无法启动 IBraceCompletionSession ,并且将返回 false。