Currently, the location tracking for doc comments isn't granular. We store a Span for the entire comment, and one for each tag (@param ..., @returns ..., etc). The spans we store for a tag includes the tag itself and the message that comes after it.
@param foo: This text is also part of the span!
This PR augments the location tracking for tags; now we track the tag @param foo and the message This text is also part of the span separately. This is more consistent with the locations we store for other Slice constructs (struct.span() doesn't include all the fields inside of it) and is more useful for the language server, which needs to differentiate between these two to tell what a user clicked on.
This also lets us remove the Overview struct. It only holds a Message and a Span. But now that Message has it's own span, Overview is kind of redundant. So I deleted it, and now wherever we held an Overview we just directly hold a Message.
This PR also adds support for adding spans together. This way we can recover the span for an entire doc comment by adding together the tag span and the message span.
Currently, the location tracking for doc comments isn't granular. We store a
Span
for the entire comment, and one for each tag (@param ...
,@returns ...
, etc). The spans we store for a tag includes the tag itself and the message that comes after it.This PR augments the location tracking for tags; now we track the tag
@param foo
and the messageThis text is also part of the span
separately. This is more consistent with the locations we store for other Slice constructs (struct.span() doesn't include all the fields inside of it) and is more useful for the language server, which needs to differentiate between these two to tell what a user clicked on.This also lets us remove the
Overview
struct. It only holds aMessage
and aSpan
. But now thatMessage
has it's own span,Overview
is kind of redundant. So I deleted it, and now wherever we held anOverview
we just directly hold aMessage
.This PR also adds support for adding spans together. This way we can recover the span for an entire doc comment by adding together the tag span and the message span.