未验证 提交 e94cd673 编写于 作者: D David 提交者: GitHub

Merge pull request #40790 from dotnet/dev/dibarbet/revert_revert_use_index

Revert "Merge pull request #40765 from dibarbet/revert_use_index"
......@@ -104,10 +104,10 @@ private static bool TryAddAsyncOrAwaitKeyword(SyntaxToken mod, List<TextSpan> sp
if (spans.Count > 0)
{
var previousToken = mod.GetPreviousToken();
var lastSpan = spans[spans.Count - 1];
var lastSpan = spans[^1];
if (lastSpan == previousToken.Span)
{
spans[spans.Count - 1] = TextSpan.FromBounds(lastSpan.Start, mod.Span.End);
spans[^1] = TextSpan.FromBounds(lastSpan.Start, mod.Span.End);
return true;
}
}
......
......@@ -108,6 +108,9 @@
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\ImmutableListExtensions.cs">
<Link>InternalUtilities\ImmutableListExtensions.cs</Link>
</Compile>
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\Index.cs">
<Link>InternalUtilities\Index.cs</Link>
</Compile>
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\ISetExtensions.cs">
<Link>InternalUtilities\ISetExtensions.cs</Link>
</Compile>
......@@ -141,6 +144,9 @@
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\PlatformInformation.cs">
<Link>InternalUtilities\PlatformInformation.cs</Link>
</Compile>
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\Range.cs">
<Link>InternalUtilities\Range.cs</Link>
</Compile>
<Compile Include="..\..\..\Compilers\Core\Portable\InternalUtilities\ReaderWriterLockSlimExtensions.cs">
<Link>InternalUtilities\ReaderWriterLockSlimExtensions.cs</Link>
</Compile>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册