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

Problem with roxygen commands #806

Closed
Dulohan opened this issue Mar 1, 2024 · 4 comments
Closed

Problem with roxygen commands #806

Dulohan opened this issue Mar 1, 2024 · 4 comments

Comments

@Dulohan
Copy link

Dulohan commented Mar 1, 2024

I have R code containing roxygen comments containing a "\donttest" statement.
Apparently nvimr has problems with this command.

Fehler in base::source(getOption("nvimcom.source.path"), ..., print.eval = print
.eval, :
C:/Users/.../Rsource-15800:91:3: unerwartet
es Symbol
90: #' @examples
91: \donttest

The code in the file reads
#' @examples
#' \donttest{
so there is a "#'" comment before the donttest.
Maybe this is a windows specific problem .

@jranke
Copy link

jranke commented Mar 2, 2024

I can reproduce this also on Linux if I send the line containing #' \donttest{ for evaluation by R, for example by moving to that line and pressing <localleader>l. In order to evaluate R code in the example section, nvim-R has to strip the roxygen comment #'. And the remaining \donttest{ syntax is not R code, which is why R complains about an unexpected symbol. I think you should be fine if you just don't include the lines containing #' \donttest{ and #' } in the region you send to R for evaluation.

@jalvesaq
Copy link
Owner

jalvesaq commented Mar 3, 2024

Thank you for the help, @jranke !

@jalvesaq jalvesaq closed this as completed Mar 3, 2024
@Dulohan
Copy link
Author

Dulohan commented Mar 4, 2024

Not sending the roxygen comments is obviously a possibility. But roxygen comments are standards in all CRAN Packages, and they are inside the routines. So this is quite inconvenient. I think it would be better for Nvim-R to be able to cope with correct roxygen comments.

@jalvesaq
Copy link
Owner

jalvesaq commented Mar 4, 2024

@Dulohan, your contribution is welcome. You can do a pull request implementing your suggestion in VimScript for Nvim-R or in Lua for R.nvim. Unfortunately, I can no longer spend as much time as I did in the past implementing features that I will never use. And, in my opinion, we have other missing features deserving more attention, such as a debugger adapter, better support for Quarto documents, perhaps integration with httpgd, etc. Unfortunately, I don't have time for them either.

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

3 participants