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
{{ message }}
Repository navigation
Code folding won't work if there is a single grammar error in one of the code trunks #501
Currently, we parse the whole document rather than chunks to provide the folding ranges, which assumes that the document is syntactically correct.
If we process rmd document chunk by chunk, then it is perfectly possible to make not only the folding ranges but also some other features more error tolerant.
changed the title [-]Code folding won't work if there is a single grammar error in one of the code trunk[/-][+]Code folding won't work if there is a single grammar error in one of the code trunks[/+]on Dec 1, 2021
Fixed by merged #752. I checked the exact good() / bad( Rmd example on current master: the folding response includes both code cells despite the syntax error in the second cell. Cell parsing is now independent, so a broken cell no longer removes folding and symbols from the rest of the document.
Activity
renkun-ken commentedon Dec 1, 2021
Currently, we parse the whole document rather than chunks to provide the folding ranges, which assumes that the document is syntactically correct.
If we process rmd document chunk by chunk, then it is perfectly possible to make not only the folding ranges but also some other features more error tolerant.
randy3k commentedon Dec 1, 2021
I think we need to at least support
eval = FALSEby the chunk options.[-]Code folding won't work if there is a single grammar error in one of the code trunk[/-][+]Code folding won't work if there is a single grammar error in one of the code trunks[/+]alanzchen commentedon Dec 1, 2021
It would also be nice to be able to alert users of grammatical errors. How difficult is this to implement?
randy3k commentedon Dec 1, 2021
Diagnostics are supported for Rmarkdown documents in
languageserver's perspective. @renkun-ken would know more about vscode.renkun-ken commentedon Oct 6, 2026
Fixed by merged #752. I checked the exact
good()/bad(Rmd example on current master: the folding response includes both code cells despite the syntax error in the second cell. Cell parsing is now independent, so a broken cell no longer removes folding and symbols from the rest of the document.Closing as resolved.