Skip to content

Add span tracking to allow emitting diagnostics everywhere #315

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

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

Conversation

oli-obk
Copy link
Contributor

@oli-obk oli-obk commented Jun 17, 2025

Instead of just tracking line numbers manually, this makes sure that everything preserves spans.

This is done by replicating most of the str API on Spanned<&str>, so that you can just use trim, to_string, chars... and keep span information at all times. I was not able to measure a performance impact on just check.

More can be done here, but I wanted to get a vibeck first before putting in more work.

Many situations already produce errors like

point of contact must be a single github username (found src/2025h2/TEMPLATE.md:16:22: must be a single Github username like @ghost)

where before they did not have file, line and col information

@lqd
Copy link
Member

lqd commented Jun 18, 2025

This looks like a good improvement to me. The error messages can be confusing rn, especially with the template bugs causing more of them.

#312 simplifies the project structure a lot, so it'd be cool if we can merge this PR after 312 🙏

@oli-obk
Copy link
Contributor Author

oli-obk commented Jun 18, 2025

Yea no worries. I'll happily rebase after that

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