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

Add onEnterRules for regular old comments in R #6049

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

juliasilge
Copy link
Contributor

Addresses #5974

The order in this JSON file is important; if you put the regular comment rule before the ones for plumber and roxygen, it takes precedence and we lose the special behavior for plumber and roxygen. It has to go after.

We have continuation behavior for Python already here:

// continue comments
{
beforeText: /^\s*#.*/,
afterText: /.+$/,
action: {
indentAction: IndentAction.None,
appendText: '# ',
},
},

It is slightly different than what we've chosen for R; it will continue in the middle of a comment but not at the end. We inherit this behavior from upstream, while the R behavior was chosen to be more like RStudio. It's a little weird that the behavior is different but maybe appropriate, for the two language communities?

Release Notes

New Features

  • Added continuation for regular comments for R

Bug Fixes

  • N/A

QA Notes

The comment continuation for roxygen (#') and plumber (#*) should continue to work in .R files in R Quarto cells, and now we will additionally continue regular old comments (#) in the same spots.

Copy link

E2E Tests 🚀
This PR will run tests tagged with: @:critical

readme  valid tags

@juliasilge juliasilge marked this pull request as ready for review January 18, 2025 01:02
@juliasilge juliasilge requested a review from jennybc January 18, 2025 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant