public virtual void VisitDocumentationReference(DocumentationReference documentationReference)
{
StartNode(documentationReference);
if (!documentationReference.DeclaringType.IsNull) {
documentationReference.DeclaringType.AcceptVisitor(this);
if (documentationReference.SymbolKind != SymbolKind.TypeDefinition) {
WriteToken(Roles.Dot);
}
}
switch (documentationReference.SymbolKind) {
case SymbolKind.TypeDefinition:
// we already printed the DeclaringType
break;
case SymbolKind.Indexer:
WriteKeyword(IndexerDeclaration.ThisKeywordRole);
break;
case SymbolKind.Operator:
var opType = documentationReference.OperatorType;
if (opType == OperatorType.Explicit) {
WriteKeyword(OperatorDeclaration.ExplicitRole);
} else if (opType == OperatorType.Implicit) {
WriteKeyword(OperatorDeclaration.ImplicitRole);
}
WriteKeyword(OperatorDeclaration.OperatorKeywordRole);
Space();
if (opType == OperatorType.Explicit || opType == OperatorType.Implicit) {
documentationReference.ConversionOperatorReturnType.AcceptVisitor(this);
} else {
WriteToken(OperatorDeclaration.GetToken(opType), OperatorDeclaration.GetRole(opType));
}
break;
default:
WriteIdentifier(documentationReference.GetChildByRole(Roles.Identifier));
break;
}
WriteTypeArguments(documentationReference.TypeArguments);
if (documentationReference.HasParameterList) {
Space(policy.SpaceBeforeMethodDeclarationParentheses);
if (documentationReference.SymbolKind == SymbolKind.Indexer) {
WriteCommaSeparatedListInBrackets(documentationReference.Parameters, policy.SpaceWithinMethodDeclarationParentheses);
} else {
WriteCommaSeparatedListInParenthesis(documentationReference.Parameters, policy.SpaceWithinMethodDeclarationParentheses);
}
}
EndNode(documentationReference);
}
#endregion