posit-dev / posit-dev/positron

Code location range errors in R kernel logs after running quarto chunk

Open Beginner friendly
#16,014 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

area: quarto lang: r
Dominant language
TypeScript
Stars
4.3k
Forks
184
Avg merge
1d 9h
Merged PRs (30d)
195

Description

Create an R chunk and run it. Open the R kernel logs, you should see an error like this:

r-f0db872e [R]   2026-09-09T13:09:13.926454Z ERROR  at crates/ark/src/console/console_repl.rs:927: Line count mismatch: location spans 0 lines, but code has 3 newlines

In https://github.com/posit-dev/positron/issues/15965, the user also hit:

  2026-09-05T16:47:11.000721Z ERROR  at crates/ark/src/console/console_repl.rs:927: Expected last line to have 0 bytes, got 56

The cause of both of these is that the code location sent by the Quarto execution manager harcodes the range to 0, see character values in:

https://github.com/posit-dev/positron/blob/093ff171bc968fcf07a47462cb04d2e0f6ee7a81/src/vs/workbench/contrib/positronQuarto/browser/quartoExecutionManager.ts#L152-L160

Instead the range should match the text sent.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in src/vs/workbench/contrib/positronQuarto/browser/quartoExecutionManager.ts at the code-location construction around lines 152-160. Run an R Quarto chunk and inspect the R kernel logs while tracing how the submitted text and range are assembled. Done means the range matches the text sent and the reported line-count or last-line errors no longer occur.

Written by the indexing model from the issue text.

Assessment

Tech stack
r, typescript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Clearly specified
Newbie friendliness
84/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.