提交 82e69433 编写于 作者: M Martin Strecker

Renamed GetTypeSyntaxOfArgument to GetNodeDenotingTheTypeOfTupleArgument and added comments.

上级 9ee59fdb
......@@ -89,7 +89,7 @@ internal static async Task<NameDeclarationInfo> GetDeclarationInfo(Document docu
result = IsFollowingTypeOrComma<ArgumentSyntax>(
token,
semanticModel,
GetTypeSyntaxOfArgument,
GetNodeDenotingTheTypeOfTupleArgument,
_ => default(SyntaxTokenList),
_ => ImmutableArray.Create(SymbolKind.Local), cancellationToken);
return result.Type != null;
......@@ -428,13 +428,18 @@ private static Accessibility GetAccessibility(SyntaxTokenList modifiers)
return Accessibility.NotApplicable;
}
private static SyntaxNode GetTypeSyntaxOfArgument(ArgumentSyntax argumentSyntax)
private static SyntaxNode GetNodeDenotingTheTypeOfTupleArgument(ArgumentSyntax argumentSyntax)
{
switch (argumentSyntax.Expression?.Kind())
{
case SyntaxKind.DeclarationExpression:
return (argumentSyntax.Expression as DeclarationExpressionSyntax).Type;
// The parser found a declaration as in (System.Action action, System.Array a$$)
// we need the type part of the declaration expression.
return ((DeclarationExpressionSyntax)argumentSyntax.Expression).Type;
default:
// We assume the parser found something that represents something named,
// e.g. a MemberAccessExpression as in (System.Action action, System.Array $$)
// We also assume that this name could be resolved to a type.
return argumentSyntax.Expression;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册