REditorSupport / REditorSupport/vscode-R

Bad highlighting of nested code chunks in R Markdown documents

Open
#1,500 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
1.2k
Forks
139
Avg merge
2h 46m
Merged PRs (30d)
5

Description

vscode-R incorrectly highlights nested code chunks in R Markdown documents, stopping after the first closing chunk. E.g.:

````{verbatim}

```{r}
foo <- 1
```

````

produces:

bad-chunk-highlight

I'd expect to have the outermost chunk (verbatim here) fully highlighted. Note that the quarto extension highlights nested code chunks properly. That would be great to get this work for .Rmd files too though.

My system:

  • OS: macOS 12.3.1
  • VSCode Version: 1.87.1
  • R version: 4.3.2
  • vscode-R version: 2.8.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the nested verbatim and r example in an .Rmd file with the vscode-R extension, then compare its highlighting with the Quarto extension. Trace the extension's R Markdown highlighting entry point; done means the outer verbatim chunk remains highlighted through its closing fence without changing ordinary chunks.

Written by the indexing model from the issue text.

Assessment

Tech stack
markdown, r, typescript, vscode
Domain
developer-experience, tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.