mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[SymbolGraph] Use identifier for type name fragments
In the cases where we specialize the presentation of type declarations in a subheading or navigator setting, make sure to use the `identifier` fragment kind instead of `typeIdentifier` to keep it consistent with the normal or "full" setting. rdar://62953144
This commit is contained in:
@@ -522,15 +522,14 @@ SymbolGraph::serializeNavigatorDeclarationFragments(StringRef Key,
|
||||
DeclarationFragmentPrinter Printer(OS, Key);
|
||||
|
||||
if (const auto *TD = dyn_cast<GenericTypeDecl>(S.getSymbolDecl())) {
|
||||
Printer.printTypeRef(TD->getInterfaceType(), TD, TD->getName(),
|
||||
PrintNameContext::Normal);
|
||||
return;
|
||||
Printer.printAbridgedType(TD, /*PrintKeyword=*/false);
|
||||
} else {
|
||||
auto Options = getSubHeadingDeclarationFragmentsPrintOptions();
|
||||
if (S.getSynthesizedBaseType()) {
|
||||
Options.setBaseType(S.getSynthesizedBaseType());
|
||||
}
|
||||
S.getSymbolDecl()->print(Printer, Options);
|
||||
}
|
||||
auto Options = getSubHeadingDeclarationFragmentsPrintOptions();
|
||||
if (S.getSynthesizedBaseType()) {
|
||||
Options.setBaseType(S.getSynthesizedBaseType());
|
||||
}
|
||||
S.getSymbolDecl()->print(Printer, Options);
|
||||
}
|
||||
|
||||
void
|
||||
@@ -540,7 +539,7 @@ SymbolGraph::serializeSubheadingDeclarationFragments(StringRef Key,
|
||||
DeclarationFragmentPrinter Printer(OS, Key);
|
||||
|
||||
if (const auto *TD = dyn_cast<GenericTypeDecl>(S.getSymbolDecl())) {
|
||||
Printer.printAbridgedType(TD);
|
||||
Printer.printAbridgedType(TD, /*PrintKeyword=*/true);
|
||||
} else {
|
||||
auto Options = getSubHeadingDeclarationFragmentsPrintOptions();
|
||||
if (S.getSynthesizedBaseType()) {
|
||||
|
||||
Reference in New Issue
Block a user