-
-
Notifications
You must be signed in to change notification settings - Fork 454
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
Include start offset in Comment
#4069
Comments
I did start going down the route of a
I did not see any library methods for consumers to manipulate Similar discussion point for |
I think Trivias are immutable for the foreseeable future so it's fine to keep them as immutable. Or maybe we can encapsulate it for a stable API, to allow us to add mutable methods in the future. |
Thanks both for coming back. Yes I see the argument for keeping |
Ack. If nobody is in a hurry, I can tackle this one later in the week. |
No hurry at all! |
This tweaks `Comment` definition in order to internally store the start and end position of its span. Closes: #4069
#4045 replaced
TriviasMap
with a sortedVec
(bravo @lucab!)After that change, there's no need to use a
Vec<(u32, Comment)>
- can change it toVec<Comment>
and movestart
field intoComment
itself. Or, probably even better, make itstruct Comment { span: Span, kind: CommentKind }
to match AST nodes.This would feel more natural to me -
start
was only external toComment
previously as it was key for the map.Side note: I'm not sure if
SortedComments
should be a boxed slice rather than aVec
. Possible that some transforms may want to add/remove comments.The text was updated successfully, but these errors were encountered: