Skip to content

API, Rustc: Rework spans (and fix a few errors) #218

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

Merged
merged 9 commits into from
Aug 22, 2023

Conversation

xFrednet
Copy link
Member

Spans are a fundamental part of linting in Rust. The previous implementation of spans in Marker were hacked together, with me always adding something new when it was needed. This PR reworks spans from the ground up.

The implementation is inspired by rustc's Span and connected data structures.

While testing, I also found a few ICEs and mistakes, that were fixed as well. The short summary:

  • Marker's Spans are now cool
  • Marker has less errors and panics
  • Changes are almost net negative

An awesome effect of this change is that the Debug format implementation of spans looks a lot better now, like this:

path/file.rs:17:6 - 17:7,

cc: #175

@xFrednet xFrednet added C-enhancement Category: New feature or request A-api Area: Stable API D-rustc-driver Driver: Rustc Driver S-waiting-on-review Status: Awaiting review I-panic Issue: Some part of the linter panicked unexpectedly A-driver Area: Driver or something related to the internal working of a driver. labels Aug 18, 2023
@xFrednet xFrednet added this to the v0.2.0 milestone Aug 18, 2023
Copy link
Contributor

@Veetaha Veetaha left a comment

Choose a reason for hiding this comment

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

Nicely done 👍

@xFrednet xFrednet force-pushed the 175-span-the-code-bow branch from 0473103 to 9a5fe9c Compare August 21, 2023 12:39
@xFrednet xFrednet added this pull request to the merge queue Aug 22, 2023
@xFrednet
Copy link
Member Author

Thank you for the review! ❤️

Merged via the queue into rust-marker:master with commit 6a5f211 Aug 22, 2023
@xFrednet xFrednet deleted the 175-span-the-code-bow branch August 22, 2023 17:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-api Area: Stable API A-driver Area: Driver or something related to the internal working of a driver. C-enhancement Category: New feature or request D-rustc-driver Driver: Rustc Driver I-panic Issue: Some part of the linter panicked unexpectedly S-waiting-on-review Status: Awaiting review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants