quarto-dev / quarto-dev/quarto
Collapsing R functions within code chunks is impossible
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 645
- Forks
- 62
- Avg merge
- 17h 42m
- Merged PRs (30d)
- 13
Description
Bug description
In .Rmd files (R Markdown language mode selected), I can fold (i.e. collapse) R multi-line functions/lists that are defined within ```{r} ... ``` chunks.
This behavior is (more or less) identical to .R files:
With a .qmd file, (Quarto language mode selected), the folding arrows are not there and folding is not possible.
Am I missing something obvious here? Shouldn't I be able to fold my function definition in R chunks in .qmd files?
Steps to reproduce
- Disable all extensions
- Enable
Quarto - Enable
R - Create a
.qmddocument and write an ```{r} ... ``` chunk with a multi-line, indented list/function/....
My settings:
My extensions:
Expected behavior
Functions and multi-line lists should be foldable.
Actual behavior
The folding arrows are not there and folding is not possible.
Your environment
IDE: VSCode 1.78.2
OS: MacOS 12.5.1
Quarto extension 1.87.3
R extension v2.8.1
Quarto check output
[✓] Checking Quarto installation......OK
Version: 1.1.189
Path: /Applications/RStudio.app/Contents/MacOS/quarto/bin
[✓] Checking basic markdown render....OK
[✓] Checking Python 3 installation....OK
Version: 3.10.8
Path: /Library/Frameworks/Python.framework/Versions/3.10/bin/python3
Jupyter: 5.3.0
Kernels: python3
[✓] Checking Jupyter engine render....OK
(/) Checking R installation...........R version 4.3.0 (2023-04-21) -- Already Tomorrow
[✓] Checking R installation...........OK
Version: 4.3.0
Path: /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources
LibPaths:
- /Users/jacques/Library/R/arm64/4.3/library
- /Library/Frameworks/R.framework/Versions/4.3-arm64/Resources/library
rmarkdown: 2.20
[✓] Checking Knitr engine render......OK
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the difference between .Rmd and .qmd files with the Quarto and R language modes enabled, using an R chunk containing a multi-line function or list. Compare folding behavior in .R and .Rmd files; done means folding arrows appear for R functions and multi-line lists inside .qmd R chunks.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- markdown, r, vscode
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100