[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:
Ashley Garland
2020-05-06 17:27:17 -07:00
parent 923def217f
commit f2c10d2ed4
5 changed files with 52 additions and 58 deletions

View File

@@ -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()) {