Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comments in R files are no longer properly highlighted if they look like #| #14592

Open
4 tasks done
olivroy opened this issue Apr 25, 2024 · 1 comment
Open
4 tasks done
Labels
automation bug layout Issues relating to layout, appearance, pane organization, etc. regression

Comments

@olivroy
Copy link
Contributor

olivroy commented Apr 25, 2024

System details

RStudio Edition : Desktop [Open Source]
RStudio Version : 2024.4.0.693
OS Version      : Windows 10 x64 (build 19045)
R Version       : R version 4.3.2 (2023-10-31 ucrt)

Steps to reproduce the problem

  1. Open R file
  2. Paste the following code
# | a ad
# | 
#---------------

#' Resolve
#' 
#' @param name description
fn <- function(x) {
  
}

Describe the problem in detail

The comment is not properly highlighted.
image

Describe the behavior you expected

Correct highliting of R comment.

Also if your comment ends with |, it breaks syntax highlighting of roxygen comments

image

I would expect a regular R comment ending with | to not break syntax highlighting in R files (I suspect it may be due to enhancement of highlighting in Quarto files, which is awesome.

I just noticed this while working on gt, since they have a logo on top of each file

  • I have read the guide for submitting good bug reports.
  • I have installed the latest version of RStudio, and confirmed that the issue still persists.
  • If I am reporting an RStudio crash, I have included a diagnostics report.
  • I have done my best to include a minimal, self-contained set of instructions for consistently reproducing the issue.
@olivroy olivroy added bug new New incoming issues, ready for initial review. labels Apr 25, 2024
@ronblum
Copy link
Contributor

ronblum commented Apr 26, 2024

Reproducible. Note that the problems occurred in different releases:

  • The incorrect comment formatting appears in 2023.12.
  • The incorrect roxygen formatting appears in 2024.04.

This occurs in R Markdown and Quarto chunks, as well.

@ronblum ronblum removed the new New incoming issues, ready for initial review. label Apr 26, 2024
@ronblum ronblum added this to the Cranberry Hibiscus milestone Apr 29, 2024
@ronblum ronblum added regression layout Issues relating to layout, appearance, pane organization, etc. automation labels Apr 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automation bug layout Issues relating to layout, appearance, pane organization, etc. regression
Projects
None yet
Development

No branches or pull requests

2 participants