Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Separate the Spans of Messages and Tags in Doc Comments #670

Merged

Conversation

InsertCreativityHere
Copy link
Member

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.

@InsertCreativityHere InsertCreativityHere merged commit 70b640e into icerpc:main Nov 6, 2023
3 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants