提交 0086652b 编写于 作者: C CyrusNajmabadi

Remove usage of TypeSwitch.

上级 a8629bfb
...@@ -39,14 +39,13 @@ internal class ReturnStatementHighlighter : AbstractKeywordHighlighter<ReturnSta ...@@ -39,14 +39,13 @@ internal class ReturnStatementHighlighter : AbstractKeywordHighlighter<ReturnSta
/// </summary> /// </summary>
private void HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans) private void HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans)
{ {
node.TypeSwitch( switch (node)
(ReturnStatementSyntax statement) => {
{ case ReturnStatementSyntax statement:
spans.Add(statement.ReturnKeyword.Span); spans.Add(statement.ReturnKeyword.Span);
spans.Add(EmptySpan(statement.SemicolonToken.Span.End)); spans.Add(EmptySpan(statement.SemicolonToken.Span.End));
}, break;
_ => default:
{
foreach (var child in node.ChildNodes()) foreach (var child in node.ChildNodes())
{ {
// Only recurse if we have anything to do // Only recurse if we have anything to do
...@@ -55,7 +54,8 @@ private void HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans) ...@@ -55,7 +54,8 @@ private void HighlightRelatedKeywords(SyntaxNode node, List<TextSpan> spans)
HighlightRelatedKeywords(child, spans); HighlightRelatedKeywords(child, spans);
} }
} }
}); break;
}
} }
} }
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册