roxygen2
roxygen2 copied to clipboard
@export does not parse correctly if it is the last tag in an R6 class roxygen doc
If the @export tag is the last tag in an R6 class roxygen comment block, it just continues parsing into the description of the next roxygen block (tested 7.0.1.9000 SHA1: #6187636).
#' Testclass
#' @export
Testclass <- R6::R6Class(
"Testclass",
public = list(
#' this line ends up in NAMESPACE !!!
#' @param x a `data.frame`
#' @return a `data.frame`
run = function(x) {
stop("Not implemented")
})
)
Will produce a NAMESPACE that contains
export("!!!")
export("in")
export(NAMESPACE)
export(ends)
export(this)
export(line)
export(up)
You need to start the method documentation with @details or @description, though, so this is not strictly a bug.
Oh thanks I did not realize that, thanks.
To turn this issue in a feature request then; Is there no way around that? It's IMHO not 100% elegant to have every method definition start with a tag. Shouldn't it be quite easy to determine the beginning of the R6 class defintion code?
p.s.: I hope I'm not to nitpicky. I'm super happy & thankful that we finally have R6 in roxygen :) I'm just in the process of translating quite a bit of documentation from my own hackish roxygen-helper-functions to roxygen 7
Is there no way around that?
There is, and we will do it soonish. It needs some internal changes in the roxygen parser, so it is not super easy. You can leave this issue open to remind us.