Skip to content

Reference correct source file and name in diagnostics in imported avdl files - #26

Merged
jonhoo merged 5 commits into
jonhoo:mainfrom
mrathelsing:mr/report-errors-in-imported-files
May 12, 2026
Merged

jonhoo merged 5 commits into
jonhoo:mainfrom
mrathelsing:mr/report-errors-in-imported-files

Conversation

@mrathelsing

@mrathelsing mrathelsing commented May 7, 2026 •

Copy link
Copy Markdown
Contributor

References used to store a Span, which is later connected with the source and source_name of the root-file, giving confusing diagnostics for errors in imported files. The first commit adds a test to show this.
The 2nd commit fixes it by making Arc's of source and source_name available throughout the visitor, stores those in the References so they can be used to generate Warnings

Reference stores a Span, which is later connected with the source and
source_name of the root-file, giving confusing diagnostics for errors
in imported files. This adds a test to prove this.
@mrathelsing mrathelsing changed the title Add Test showing Unknown-Type diagnostics are reported on wrong file Reference correct source file and name in diagnostics in imported avdl files May 7, 2026
@mrathelsing
mrathelsing force-pushed the mr/report-errors-in-imported-files branch from 493f67b to 3986395 Compare May 7, 2026 21:32
@codecov-commenter

codecov-commenter commented May 8, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 96.81529% with 5 lines in your changes missing coverage. Please review.
✅ Project coverage is 96.2%. Comparing base (3dbcdbd) to head (68b1c75).

Files with missing lines Patch % Lines
src/reader.rs 94.1% 4 Missing ⚠️
src/error.rs 97.5% 1 Missing ⚠️
Additional details and impacted files
Files with missing lines Coverage Δ
src/compiler.rs 96.6% <100.0%> (-0.6%) ⬇️
src/model/schema.rs 96.9% <ø> (ø)
src/resolve.rs 99.6% <100.0%> (ø)
src/error.rs 98.5% <97.5%> (-1.5%) ⬇️
src/reader.rs 94.1% <94.1%> (-0.1%) ⬇️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Comment thread src/compiler.rs Outdated
The Arc would allocate would all be freed, just before the program
exits, so leaking has no downside here

@jonhoo jonhoo left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Approving since the last few bits are relatively minor/easy to fix

Comment thread src/compiler.rs Outdated
Comment thread src/error.rs Outdated
Comment thread src/compiler.rs
Comment thread src/compiler.rs Outdated
Comment thread src/reader.rs Outdated
@jonhoo
jonhoo merged commit a0c9932 into jonhoo:main May 12, 2026
16 checks passed
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.

3 participants