Skip to content
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

Rework spans source information and add more utility functions for spans #175

Closed
xFrednet opened this issue Jul 14, 2023 · 4 comments
Closed
Assignees
Labels
A-api Area: Stable API C-enhancement Category: New feature or request
Milestone

Comments

@xFrednet
Copy link
Member

Span are a fundamental part of a linting interface. They define what should be shown in diagnostic messages and where to apply suggestions. Marker currently only has a limited Span implementation and a simple snippet function. Clippy and rustc both have a collection of util function to make it easier to deal with spans. It might be cool for Marker to have something similar.

See:

This util might need to be part of the marker_api crate to allow driver callbacks, similar to how the AstContext currently works :)

@xFrednet xFrednet added C-enhancement Category: New feature or request A-api Area: Stable API labels Jul 14, 2023
@xFrednet xFrednet changed the title Add more utility functions for spans Rework spans and add more utility functions for spans Jul 16, 2023
@xFrednet
Copy link
Member Author

Spans in general should be updated to include more information about where they came from, like from which macro and if they have parent spans. See the fixme comment above the SpanSource struct.

@xFrednet xFrednet changed the title Rework spans and add more utility functions for spans Rework spans source information and add more utility functions for spans Jul 16, 2023
@xFrednet
Copy link
Member Author

xFrednet commented Aug 9, 2023

I'll work on the source information and, in general, making spans more rounded. :)

Not sure if I'll complete this before v0.2.0, but we'll see :)

@xFrednet xFrednet self-assigned this Aug 9, 2023
@xFrednet xFrednet added this to the v0.2.0 milestone Aug 9, 2023
@xFrednet
Copy link
Member Author

Just understanding all the variations of spans and macro expansion and documenting my current understanding is taking a significant amount of time. I never knew that spans were this complicated. In Clippy, we generally just abort if the code originates from a macro.

Oh well, when I have a working branch, this will probably be the best documented part of the API. Right now, it has about 150 lines of new doc comments. ^^

@xFrednet
Copy link
Member Author

I've reworked the spans in #218, Marker should still include more util methods, but for now, I consider this issue to be resolved :)

I'll try create issues for more util methods soon :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-api Area: Stable API C-enhancement Category: New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant