[SourceKit] Add documentation range in structure (SR-2487) (#11264)

This commit is contained in:
Marcelo Fabri
2017-08-02 20:39:49 +00:00
committed by Xi Ge
parent 0c44bbd9a5
commit d16cce3a94
15 changed files with 136 additions and 37 deletions

View File

@@ -1027,6 +1027,15 @@ public:
BodyOffset = BodyEnd = 0;
}
unsigned DocOffset = 0;
unsigned DocEnd = 0;
if (Node.DocRange.isValid()) {
DocOffset = SrcManager.getLocOffsetInBuffer(Node.DocRange.getStart(),
BufferID);
DocEnd = SrcManager.getLocOffsetInBuffer(Node.DocRange.getEnd(),
BufferID);
}
UIdent Kind = SwiftLangSupport::getUIDForSyntaxStructureKind(Node.Kind);
UIdent AccessLevel;
UIdent SetterAccessLevel;
@@ -1080,6 +1089,7 @@ public:
Kind, AccessLevel, SetterAccessLevel,
NameStart, NameEnd - NameStart,
BodyOffset, BodyEnd - BodyOffset,
DocOffset, DocEnd - DocOffset,
DisplayName,
TypeName, RuntimeName,
SelectorName,
@@ -1144,7 +1154,7 @@ public:
UIdent Kind = SwiftLangSupport::getUIDForSyntaxNodeKind(Node.Kind);
Consumer.beginDocumentSubStructure(StartOffset, EndOffset - StartOffset,
Kind, UIdent(), UIdent(), 0, 0,
0, 0,
0, 0, 0, 0,
StringRef(),
StringRef(), StringRef(),
StringRef(),