Rather than use the same highlight rules (and so, same highlighter state) for both R code chunks and \Sexpr{} code blocks, use separate highlighter sets. This is necessary as we need to track the { and} count within \Sexpr{} calls, but not within regular R code chunks.
Automated Tests
Included in PR.
QA Notes
Test via notes in associated issues.
Documentation
N/A
Checklist
[ ] If this PR adds a new feature, or fixes a bug in a previously released version, it includes an entry in NEWS.md
Intent
Addresses https://github.com/rstudio/rstudio/issues/14667. Addresses https://github.com/rstudio/rstudio/issues/14646.
Approach
Rather than use the same highlight rules (and so, same highlighter state) for both R code chunks and \Sexpr{} code blocks, use separate highlighter sets. This is necessary as we need to track the
{
and}
count within\Sexpr{}
calls, but not within regular R code chunks.Automated Tests
Included in PR.
QA Notes
Test via notes in associated issues.
Documentation
N/A
Checklist
NEWS.md