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

fix: allow returns tag to be used in r6 methods #1691

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions R/rd-r6.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ topic_add_r6_methods <- function(rd, block, env) {
methods <- methods[order(methods$file, methods$line), ]
methods$tags <- replicate(nrow(methods), list(), simplify = FALSE)

r6_tags <- c("description", "details", "param", "return", "examples")
r6_tags <- c("description", "details", "param", "return", "returns", "examples")

del <- integer()
for (i in seq_along(block$tags)) {
Expand Down Expand Up @@ -414,7 +414,7 @@ r6_method_params <- function(block, method) {
}

r6_method_return <- function(block, method) {
ret <- purrr::keep(method$tags[[1]], function(t) t$tag == "return")
ret <- purrr::keep(method$tags[[1]], function(t) t$tag %in% c("return", "returns"))
if (length(ret) == 0) return()
if (length(ret) > 1) {
warn_roxy_block(block, "Must use one @return per R6 method")
Expand Down
Loading