本文整理汇总了C#中Microsoft.CodeAnalysis.SyntaxTree.IsInInactiveRegion方法的典型用法代码示例。如果您正苦于以下问题:C# SyntaxTree.IsInInactiveRegion方法的具体用法?C# SyntaxTree.IsInInactiveRegion怎么用?C# SyntaxTree.IsInInactiveRegion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Microsoft.CodeAnalysis.SyntaxTree
的用法示例。
在下文中一共展示了SyntaxTree.IsInInactiveRegion方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryGetBreakpointSpan
internal static bool TryGetBreakpointSpan(SyntaxTree tree, int position, CancellationToken cancellationToken, out TextSpan breakpointSpan)
{
var source = tree.GetText(cancellationToken);
// If the line is entirely whitespace, then don't set any breakpoint there.
var line = source.Lines.GetLineFromPosition(position);
if (IsBlank(line))
{
breakpointSpan = default(TextSpan);
return false;
}
// If the user is asking for breakpoint in an inactive region, then just create a line
// breakpoint there.
if (tree.IsInInactiveRegion(position, cancellationToken))
{
breakpointSpan = default(TextSpan);
return true;
}
var root = tree.GetRoot(cancellationToken);
return root.TryGetClosestBreakpointSpan(position, out breakpointSpan);
}