Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

inheritParams does not find doc'ed multi-params #1426

Closed
LiNk-NY opened this issue Aug 31, 2022 · 2 comments
Closed

inheritParams does not find doc'ed multi-params #1426

LiNk-NY opened this issue Aug 31, 2022 · 2 comments

Comments

@LiNk-NY
Copy link
Contributor

LiNk-NY commented Aug 31, 2022

When multiple parameters are documented in a single @param or \arguments{ \item{a, b}{} }, the referent documentation does not include the documentation of that parameter.

Minimal example

#' test function
#' This is a test function
#' @return A message
#'
#' @inheritParams testing
#'
#' @export
test <- function(b) {
    message("This is a test")
}


#' Another test function
#' @param a,b character(1) A letter, either lowercase or uppercase
#' @return Another message
#'
#' @export
testing <- function(a, b) {
    message("This is also a test")
}

The test function does not get any generated documentation for argument b even though it inherits the arguments of the testing function which are documented.

Expected behavior

test.Rd should have the following included:

\arguments{
\item{b}{character(1) A letter, either lowercase or uppercase}
}

Observed behavior

The \arguments section is missing from the test.Rd.

Roxygen version

RoxygenNote: 7.2.1

Example repository

https://github.com/Link-NY/testPkg

cc: @hadley

@hadley
Copy link
Member

hadley commented Sep 1, 2022

See the news:

@inheritParams now only inherits exact multiparameter matches, so if you're inheriting from a function with @param x,y you'll only get the parameter documentation if your function needs docs for both x and y (#950).

And please don't @ me unless there's some specific urgent issue that I need to be aware of. This is not such an issue.

@hadley hadley closed this as completed Sep 1, 2022
@LiNk-NY
Copy link
Contributor Author

LiNk-NY commented Sep 1, 2022

Thanks Hadley. Perhaps include the note in the issue template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants