提交 3d4c0a84 编写于 作者: C CyrusNajmabadi

Simplify line check.

上级 0e291748
......@@ -45,15 +45,15 @@ protected abstract class Analyzer<TBaseArgumentSyntax, TArgumentSyntax, TArgumen
return;
}
// Arguments can be arbitrarily large. Only offer this feature if the caret is in the
// span of the argument, and on the same line that the argument starts in.
// Arguments can be arbitrarily large. Only offer this feature if the caret is on hte
// line that the argument starts on.
var sourceText = await document.GetTextAsync(cancellationToken).ConfigureAwait(false);
var lineSpan = sourceText.Lines.GetLineFromPosition(argument.Span.Start).Span;
var argumentSpan = argument.FullSpan;
var intersection = argumentSpan.Intersection(lineSpan);
if (intersection?.IntersectsWith(context.Span.Start) != true)
var argumentStartLine = sourceText.Lines.GetLineFromPosition(argument.Span.Start).LineNumber;
var caretLine = sourceText.Lines.GetLineFromPosition(context.Span.Start).LineNumber;
if (argumentStartLine != caretLine)
{
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册