public static ParameterInfo GetParameterInfoOrThrow( this SemanticModel semanticModel, ArgumentSyntax argumentSyntax) { var argumentInfo = semanticModel.GetArgumentInfo(argumentSyntax); if (argumentInfo.IsEmpty) { throw new InvalidOperationException( $"Could not find the corresponding parameter for [{argumentSyntax}]"); } return(argumentInfo); }