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

Support semi colons on single line in statement range detection #638

Merged
merged 4 commits into from
Dec 9, 2024

Conversation

lionel-
Copy link
Contributor

@lionel- lionel- commented Nov 25, 2024

Branched from #636.
Addresses posit-dev/positron#4317

Adds a dependency of statement-range on the R parser. This is consistent with our plans to make evaluation of selections depend on the R parser as well (complete expressions detection).

When a statement range is requested, we simply check if the whole line completely parses. If that's the case we return the line range. This tactic doesn't work if multiline expressions are separated by semi-colons. We can find a better way when we switch to a Rowan implementation.

No longer doing this, instead using #644, which does not use the R parser.

Positron Release Notes

New Features

  • N/A

Bug Fixes

Positron QA Notes

Cmd/Ctrl + Enter on that line (or an empty preceding line) should run the entire line:

1; 2; 3

A semi-colon following a multiline expression is also supported, so for instance this should also evaluate everything if you put your cursor on the { and hit Cmd + Enter

{
  1
}; 2

@lionel- lionel- requested a review from DavisVaughan November 25, 2024 11:31
Base automatically changed from task/refactor-statement-range-tests to main November 27, 2024 13:36
@DavisVaughan DavisVaughan force-pushed the bugfix/statement-semi-colons branch from 472359c to 921fef4 Compare December 9, 2024 15:39
@DavisVaughan DavisVaughan merged commit fa05ce6 into main Dec 9, 2024
6 checks passed
@DavisVaughan DavisVaughan deleted the bugfix/statement-semi-colons branch December 9, 2024 16:00
@github-actions github-actions bot locked and limited conversation to collaborators Dec 9, 2024
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