mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sourcekit/DocSupport: fix an assertion when generating documentation for extensions with attributes
When sanitizing the documentation comments for synthesized extensions, we expect some text like "<declaration>extension". This isn't the case when use-facing attributes are present. rdar://50913510
This commit is contained in:
@@ -368,7 +368,7 @@ static bool initDocEntityInfo(const Decl *D,
|
||||
StringRef DocRef = (StringRef)DocBuffer;
|
||||
if (IsSynthesizedExtension &&
|
||||
DocRef.find("<Declaration>") != StringRef::npos) {
|
||||
StringRef Open = "<Declaration>extension ";
|
||||
StringRef Open = "extension ";
|
||||
assert(DocRef.find(Open) != StringRef::npos);
|
||||
auto FirstPart = DocRef.substr(0, DocRef.find(Open) + (Open).size());
|
||||
auto SecondPart = DocRef.substr(FirstPart.size());
|
||||
|
||||
Reference in New Issue
Block a user