R: Statement range provider needs to take `column` into account
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 337
- Forks
- 32
- Avg merge
- 8d 17h
- Merged PRs (30d)
- 11
Description
From https://github.com/posit-dev/positron/issues/1464#issuecomment-1787666141
if (TRUE) { # press CMD+Enter here
print('yes')
}; lapply(1:5, print) # You'll jump past the lapply and it wont execute
I think this is a bug on our end where we aren't taking the column into account (I didn't think we needed to).
RStudio will run both expressions in 1 CMD + Enter press. I'm not sure we want that. I feel like it would be better to stop at the l of the lapply()
Another probably related bug:
if (TRUE)
1 + 1 else 2 + 2 # place your cursor on the `2 + 2` and hit CMD+Enter, it will run `1 + 1`
I'm not entirely sure what this should do, but the current behavior is odd (note that RStudio is also weird here and just runs the whole 2nd line, which also fails to parse)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the statement range provider and reproduce both R examples with the cursor at the shown positions, checking how the current range uses line and column. Done means the CMD+Enter range behavior is explicitly decided for both cases and matches the chosen expectations, with regression coverage for the reproductions.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- r, rust
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100