mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[SourceKit] Add documentation range in structure (SR-2487) (#11264)
This commit is contained in:
@@ -247,3 +247,18 @@ StringRef Decl::getBriefComment() const {
|
||||
Context.setBriefComment(this, Result);
|
||||
return Result;
|
||||
}
|
||||
|
||||
CharSourceRange RawComment::getCharSourceRange() {
|
||||
if (this->isEmpty()) {
|
||||
return CharSourceRange();
|
||||
}
|
||||
|
||||
auto Start = this->Comments.front().Range.getStart();
|
||||
if (Start.isInvalid()) {
|
||||
return CharSourceRange();
|
||||
}
|
||||
auto End = this->Comments.back().Range.getEnd();
|
||||
auto Length = (char *)End.getOpaquePointerValue() -
|
||||
(char* )Start.getOpaquePointerValue();
|
||||
return CharSourceRange(Start, Length);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user