You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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
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
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. ^^
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 simplesnippet
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:
SourceMap
clippy_utils::source
This util might need to be part of the
marker_api
crate to allow driver callbacks, similar to how theAstContext
currently works :)The text was updated successfully, but these errors were encountered: