提交 5cfc561a 编写于 作者: J Jonathon Marolf

Fixing typo and using 'IsMissing'

上级 1f445f9a
......@@ -68,7 +68,7 @@ internal class CSharpAddAwaitCodeFixProvider : AbstractAddAsyncAwaitCodeFixProvi
return Task.FromResult(root.ReplaceNode(oldNode, ConvertToAwaitExpression(expression)));
case CS0029:
if (!DoesExpressionReturnGenricTaskWhoseArgumentsMatchLeftSide(expression, semanticModel, document.Project, cancellationToken))
if (!DoesExpressionReturnGenericTaskWhoseArgumentsMatchLeftSide(expression, semanticModel, document.Project, cancellationToken))
{
return SpecializedTasks.Default<SyntaxNode>();
}
......@@ -94,7 +94,7 @@ private static bool DoesExpressionReturnTask(ExpressionSyntax expression, Semant
semanticModel.Compilation.ClassifyConversion(taskType, returnType).Exists;
}
private static bool DoesExpressionReturnGenricTaskWhoseArgumentsMatchLeftSide(ExpressionSyntax expression, SemanticModel semanticModel, Project project, CancellationToken cancellationToken)
private static bool DoesExpressionReturnGenericTaskWhoseArgumentsMatchLeftSide(ExpressionSyntax expression, SemanticModel semanticModel, Project project, CancellationToken cancellationToken)
{
if (expression == null)
{
......@@ -139,7 +139,7 @@ private static bool IsInAsyncFunction(ExpressionSyntax expression)
case SyntaxKind.ParenthesizedLambdaExpression:
case SyntaxKind.SimpleLambdaExpression:
case SyntaxKind.AnonymousMethodExpression:
return (node as AnonymousFunctionExpressionSyntax)?.AsyncKeyword.Kind() == SyntaxKind.AsyncKeyword;
return (node as AnonymousFunctionExpressionSyntax)?.AsyncKeyword.IsMissing == true;
case SyntaxKind.MethodDeclaration:
return (node as MethodDeclarationSyntax)?.Modifiers.Any(SyntaxKind.AsyncKeyword) == true;
default:
......
......@@ -38,7 +38,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeFixes.Async
Select Case diagnostic.Id
Case BC30311
If Not DoesExpressionReturnGenricTaskWhoseArgumentsMatchLeftSide(expression, semanticModel, document.Project, cancellationToken) Then
If Not DoesExpressionReturnGenericTaskWhoseArgumentsMatchLeftSide(expression, semanticModel, document.Project, cancellationToken) Then
Return Task.FromResult(Of SyntaxNode)(Nothing)
End If
Return Task.FromResult(root.ReplaceNode(oldNode, ConverToAwaitExpression(expression)))
......@@ -57,7 +57,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeFixes.Async
End Select
End Function
Private Function DoesExpressionReturnGenricTaskWhoseArgumentsMatchLeftSide(expression As ExpressionSyntax, semanticModel As SemanticModel, project As Project, cancellationToken As CancellationToken) As Boolean
Private Function DoesExpressionReturnGenericTaskWhoseArgumentsMatchLeftSide(expression As ExpressionSyntax, semanticModel As SemanticModel, project As Project, cancellationToken As CancellationToken) As Boolean
If expression Is Nothing Then
Return False
End If
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册