Skip to content

Conversation

jkrumbiegel
Copy link
Collaborator

This PR is the QNR side of fixing #310, the corresponding PR in quarto-cli is quarto-dev/quarto-cli#13401. This PR will have to be merged and tagged first before the quarto PR can pass final CI and be merged as well. The change is backwards compatible in that if no source ranges are supplied, the original file's line numbers are used like before.

The effect of this is that evaluated Julia cells get the correct file paths and line numbers so that code in includes can be correctly traced back. For example something like this (plus includes that also print file and line)

---
keep-md: true
engine: julia
---

{{< include "subfolder/_include.qmd" >}}

This is some text in scratch.qmd

```{julia}
"$(@__FILE__):$(@__LINE__)"
```

gives something like this

image

Copy link

codecov bot commented Sep 23, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 80.10%. Comparing base (fa10ed9) to head (5d622ba).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #339      +/-   ##
==========================================
+ Coverage   79.43%   80.10%   +0.67%     
==========================================
  Files          39       39              
  Lines        2071     2106      +35     
==========================================
+ Hits         1645     1687      +42     
+ Misses        426      419       -7     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Collaborator

@MichaelHatherly MichaelHatherly left a comment

Choose a reason for hiding this comment

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

Only one changed requested to avoid accessing a field and rather using first() instead.

@jkrumbiegel
Copy link
Collaborator Author

I wasn't sure at first if there could be empty ranges (for which first would error) but I think that can't happen even in the weird cases that quarto inserts

@jkrumbiegel jkrumbiegel merged commit 9de5866 into main Sep 26, 2025
11 checks passed
@jkrumbiegel jkrumbiegel deleted the jk/source-ranges branch September 26, 2025 13:36
@jkrumbiegel jkrumbiegel restored the jk/source-ranges branch September 26, 2025 13:37
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.

2 participants