You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I know this is a specific case.
I am building functions inside a Rmarkdown document, which builds chunks.
I remarked that, as soon as there is 3 backticks in my code, the VSCode document outline is not displayed.
Here is a reprex.
With this code, there is no outline available in VSCode, near the Rmd name
---title: "test vscode"output: html_documentauthor: statnmap---```{r development, include=FALSE}
library(testthat)```# combine_tbl_to_file```{r function}
#' Create R code chunk content#' @return A character string of R code chunk content#' @noRdcreate_r_chunk <- function() { paste( "```{r}", "```", sep = "\n" )}cat(create_r_chunk())```
As soon as I remove the paste with backticks, the outline is correct:
---title: "test vscode"output: html_documentauthor: statnmap---```{r development, include=FALSE}
library(testthat)```# combine_tbl_to_file```{r function}
#' Create R code chunk content#' @return A character string of R code chunk content#' @noRdcreate_r_chunk <- function() { paste( "", sep = "\n" )}cat(create_r_chunk())```
Maybe the parsing you use to detect chunks can be a little more restrictive, and only considering chunks when there is nothing or spaces before the backticks ?
I know this is a specific case.
I am building functions inside a Rmarkdown document, which builds chunks.
I remarked that, as soon as there is 3 backticks in my code, the VSCode document outline is not displayed.
Here is a reprex.
With this code, there is no outline available in VSCode, near the Rmd name
As soon as I remove the paste with backticks, the outline is correct:
Maybe the parsing you use to detect chunks can be a little more restrictive, and only considering chunks when there is nothing or spaces before the backticks ?
You could maybe use patterns used by {knitr}:
The text was updated successfully, but these errors were encountered: