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

Inconsistent @title and @description line numbers in parsed blocks #1235

Closed
davidrubinger opened this issue Jun 18, 2021 · 0 comments
Closed
Labels
bug an unexpected problem or unintended behavior rd ✍️
Milestone

Comments

@davidrubinger
Copy link

davidrubinger commented Jun 18, 2021

When using the parse functions, the line numbers associated with the @title and @description tags in the parsed blocks don't seem to be relative to the entire text, but relative to the individual block, unlike for other tags (e.g., @param):

text <- "
# Example
# 
#' Title 1
#' 
#' Description 1
#' 
#' @param x description
f1 <- function(x) {x}

#' Title 2
#' 
#' Description 2
#' 
#' @param x description
f2<- function(x) {x}"

roxygen2::parse_text(text)
#> [[1]]
#> <roxy_block> [<text>:9]
#>   $tag
#>     [line:  1] @title 'Title 1' {parsed}
#>     [line:  3] @description 'Description 1' {parsed}
#>     [line:  8] @param 'x description' {parsed}
#>     [????:???] @usage '<generated>' {parsed}
#>     [????:???] @.formals '<generated>' {parsed}
#>     [????:???] @backref '<text>' {parsed}
#>   $call   f1 <- function(x) { ...
#>   $object <function> 
#>     $topic f1
#>     $alias f1
#> 
#> [[2]]
#> <roxy_block> [<text>:16]
#>   $tag
#>     [line:  1] @title 'Title 2' {parsed}
#>     [line:  3] @description 'Description 2' {parsed}
#>     [line: 15] @param 'x description' {parsed}
#>     [????:???] @usage '<generated>' {parsed}
#>     [????:???] @.formals '<generated>' {parsed}
#>     [????:???] @backref '<text>' {parsed}
#>   $call   f2 <- function(x) { ...
#>   $object <function> 
#>     $topic f2
#>     $alias f2
@hadley hadley added bug an unexpected problem or unintended behavior rd ✍️ labels Mar 29, 2022
@hadley hadley added this to the v7.1.3 milestone Mar 29, 2022
@hadley hadley closed this as completed in 256c900 Mar 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior rd ✍️
Projects
None yet
Development

No branches or pull requests

2 participants