mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SourceKit] Update the way of representing USRs for synthesized extensions.
Instead of using 'key.usr' and 'key.synthesizedusr', we start to use 'key.usr' and 'key.original-usr' so that 'key.usr' is consistently being the unique ID for a code entity.
This commit is contained in:
@@ -251,14 +251,17 @@ static bool initDocEntityInfo(const Decl *D, const Decl *SynthesizedTarget,
|
||||
if (const ValueDecl *VD = dyn_cast<ValueDecl>(D)) {
|
||||
llvm::raw_svector_ostream NameOS(Info.Name);
|
||||
SwiftLangSupport::printDisplayName(VD, NameOS);
|
||||
|
||||
llvm::raw_svector_ostream OS(Info.USR);
|
||||
SwiftLangSupport::printUSR(VD, OS);
|
||||
if (SynthesizedTarget) {
|
||||
llvm::raw_svector_ostream OS(Info.SynthesizedUSR);
|
||||
{
|
||||
llvm::raw_svector_ostream OS(Info.USR);
|
||||
SwiftLangSupport::printUSR(VD, OS);
|
||||
OS << SwiftLangSupport::SynthesizedUSRSeparator;
|
||||
SwiftLangSupport::printUSR(dyn_cast<ValueDecl>(SynthesizedTarget), OS);
|
||||
if (SynthesizedTarget) {
|
||||
OS << SwiftLangSupport::SynthesizedUSRSeparator;
|
||||
SwiftLangSupport::printUSR(dyn_cast<ValueDecl>(SynthesizedTarget), OS);
|
||||
{
|
||||
llvm::raw_svector_ostream OS(Info.OriginalUSR);
|
||||
SwiftLangSupport::printUSR(VD, OS);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user