Skip to content

Commit 8eb2c50

Browse files
don't split attribute fragments with a separate typeIdentifier fragment
rdar://104930571
1 parent 3b4d03c commit 8eb2c50

File tree

2 files changed

+3
-6
lines changed

2 files changed

+3
-6
lines changed

lib/SymbolGraphGen/DeclarationFragmentPrinter.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,8 @@ void DeclarationFragmentPrinter::printStructurePre(PrintStructureKind Kind,
136136
void DeclarationFragmentPrinter::printTypeRef(Type T, const TypeDecl *RefTo,
137137
Identifier Name,
138138
PrintNameContext NameContext) {
139-
openFragment(FragmentKind::TypeIdentifier);
139+
if (Kind != FragmentKind::Attribute)
140+
openFragment(FragmentKind::TypeIdentifier);
140141
printText(Name.str());
141142
USR.clear();
142143

test/SymbolGraph/Symbols/Mixins/DeclarationFragments/Full/CustomAttr.swift

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ public func wrapped(@SomeWrapper arg: Int) {}
3232
// CHECK-NEXT: },
3333
// CHECK-NEXT: {
3434
// CHECK-NEXT: "kind": "attribute",
35-
// CHECK-NEXT: "spelling": "@"
36-
// CHECK-NEXT: },
37-
// CHECK-NEXT: {
38-
// CHECK-NEXT: "kind": "typeIdentifier",
39-
// CHECK-NEXT: "spelling": "SomeWrapper",
35+
// CHECK-NEXT: "spelling": "@SomeWrapper",
4036
// CHECK-NEXT: "preciseIdentifier": "s:10CustomAttr11SomeWrapperV"
4137
// CHECK-NEXT: },
4238
// CHECK-NEXT: {

0 commit comments

Comments
 (0)