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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

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.

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 not supported yet, so for instance this would evaluate only the braces:

{
  1
}; 2

Base automatically changed from task/refactor-statement-range-tests to main November 27, 2024 13:36
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