提交 254a6311 编写于 作者: C CyrusNajmabadi

renamed methods.

上级 d6436768
......@@ -2,6 +2,7 @@
using System;
using System.Composition;
using System.Diagnostics;
using System.Linq;
using System.Threading;
using System.Threading.Tasks;
......@@ -171,12 +172,14 @@ private TextSpan ExpandSpan(SourceText sourceText, TextSpan span, bool fullyQual
var start = span.Start;
var end = span.Start;
while (start > 0 && ExpandBackward(sourceText, start, fullyQualifiedName))
while (start > 0 &&
ShouldExpandSpanBackwardOneCharacter(sourceText, start, fullyQualifiedName))
{
start--;
}
while (end < sourceText.Length && ExpandForward(sourceText, end, fullyQualifiedName))
while (end < sourceText.Length &&
ShouldExpandSpanForwardOneCharacter(sourceText, end, fullyQualifiedName))
{
end++;
}
......@@ -184,7 +187,7 @@ private TextSpan ExpandSpan(SourceText sourceText, TextSpan span, bool fullyQual
return TextSpan.FromBounds(start, end);
}
private bool ExpandForward(SourceText sourceText, int end, bool fullyQualifiedName)
private bool ShouldExpandSpanForwardOneCharacter(SourceText sourceText, int end, bool fullyQualifiedName)
{
var currentChar = sourceText[end];
......@@ -204,9 +207,11 @@ private bool ExpandForward(SourceText sourceText, int end, bool fullyQualifiedNa
return false;
}
private bool ExpandBackward(
private bool ShouldExpandSpanBackwardOneCharacter(
SourceText sourceText, int start, bool fullyQualifiedName)
{
Debug.Assert(start > 0);
var previousCharacter = sourceText[start - 1];
if (char.IsLetterOrDigit(previousCharacter))
{
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册