@@ -76,15 +76,30 @@ void Symbol::serializeKind(llvm::json::OStream &OS) const {
7676
7777void Symbol::serializeIdentifier (SymbolGraphASTWalker &Walker,
7878 llvm::json::OStream &OS) const {
79- AttributeRAII A (" identifier" , OS);
80- Walker.getSymbolIdentifier (VD).serialize (OS);
79+ OS.attributeObject (" identifier" , [&](){
80+ OS.attribute (" precise" , Walker.getUSR (VD));
81+ OS.attribute (" interfaceLanguage" , " swift" );
82+ });
83+ }
84+
85+ void Symbol::serializePathComponents (SymbolGraphASTWalker &Walker,
86+ llvm::json::OStream &OS) const {
87+ OS.attributeArray (" pathComponents" , [&](){
88+ SmallVector<SmallString<32 >, 8 > PathComponents;
89+ Walker.getPathComponents (VD, PathComponents);
90+ for (auto Component : PathComponents) {
91+ OS.value (Component);
92+ }
93+ });
8194}
8295
8396void Symbol::serializeNames (SymbolGraphASTWalker &Walker,
8497 llvm::json::OStream &OS) const {
8598 OS.attributeObject (" names" , [&](){
86- auto Identifier = Walker.getSymbolIdentifier (VD);
87- OS.attribute (" title" , Identifier.SimpleComponents .back ());
99+ SmallVector<SmallString<32 >, 8 > PathComponents;
100+ Walker.getPathComponents (VD, PathComponents);
101+
102+ OS.attribute (" title" , PathComponents.back ());
88103 // "navigator": null
89104 Walker.serializeSubheadingDeclarationFragments (" subheading" , VD, OS);
90105 // "prose": null
@@ -370,6 +385,7 @@ void Symbol::serialize(SymbolGraphASTWalker &Walker,
370385 OS.object ([&](){
371386 serializeKind (OS);
372387 serializeIdentifier (Walker, OS);
388+ serializePathComponents (Walker, OS);
373389 serializeNames (Walker, OS);
374390 serializeDocComment (Walker, OS);
375391
0 commit comments