Skip to content

Fix regression in region detection #857

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

Merged
merged 2 commits into from
Jun 30, 2025
Merged

Conversation

lionel-
Copy link
Contributor

@lionel- lionel- commented Jun 26, 2025

Finishes addressing posit-dev/positron#8059 (see #842 for first part).

I mistakenly thought that VSCode regions were spec'd as:

*comment_opener* #region

I.e. you need // #region in Javascript or C. However I now see that for Python, which shares with R the # symbol as comment opener, it's actually:

*comment_opener*[optional_space]region

See https://github.com/microsoft/vscode/blob/d6d5034ff685d6aab2c1f226fef288455caa7a14/extensions/python/language-configuration.json#L45-L48

So I've just copied over their regexes for detection of regions.

@lionel- lionel- requested a review from juliasilge June 27, 2025 11:01
Copy link
Contributor

@juliasilge juliasilge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is working again:

Screenshot 2025-06-27 at 1 57 51 PM

This is related to the work I did in posit-dev/positron#4174. Should we now remove this language config from the R extension:

https://github.com/posit-dev/positron/blob/4fe4b95d19119356474217c5520fbf0cf22afef5/extensions/positron-r/language-configuration/r-language-configuration.json#L29-L34

I am thinking yes. Maybe make that change when you bump ark for this PR, and then ping me for review again to confirm everything is as expected.

@lionel- lionel- merged commit 74d3f1d into main Jun 30, 2025
6 checks passed
@lionel- lionel- deleted the bugfix/region-folding-range branch June 30, 2025 07:52
@github-actions github-actions bot locked and limited conversation to collaborators Jun 30, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants