public static GetOverloadId ( ISymbol symbol ) : string | ||
symbol | ISymbol | |
return | string |
public override void VisitMethod(IMethodSymbol symbol) { var id = _asOverload ? VisitorHelper.GetOverloadId(symbol.OriginalDefinition) : VisitorHelper.GetId(symbol.OriginalDefinition); ReferenceItem.Parts[SyntaxLanguage.VB].Add(new LinkItem { DisplayName = NameVisitorCreator.GetVB(_asOverload ? NameOptions.WithMethodGenericParameter : NameOptions.WithGenericParameter).GetName(symbol), DisplayNamesWithType = NameVisitorCreator.GetVB(NameOptions.WithType | (_asOverload ? NameOptions.WithMethodGenericParameter : NameOptions.WithGenericParameter)).GetName(symbol), DisplayQualifiedNames = NameVisitorCreator.GetVB(NameOptions.Qualified | (_asOverload ? NameOptions.WithMethodGenericParameter : NameOptions.WithGenericParameter)).GetName(symbol), Name = id, IsExternalPath = symbol.IsExtern || symbol.DeclaringSyntaxReferences.Length == 0, }); if (_asOverload) { return; } ReferenceItem.Parts[SyntaxLanguage.VB].Add(new LinkItem { DisplayName = "(", DisplayNamesWithType = "(", DisplayQualifiedNames = "(", }); for (int i = 0; i < symbol.Parameters.Length; i++) { if (i > 0) { ReferenceItem.Parts[SyntaxLanguage.VB].Add(new LinkItem { DisplayName = ", ", DisplayNamesWithType = ", ", DisplayQualifiedNames = ", ", }); } symbol.Parameters[i].Type.Accept(this); } ReferenceItem.Parts[SyntaxLanguage.VB].Add(new LinkItem { DisplayName = ")", DisplayNamesWithType = ")", DisplayQualifiedNames = ")", }); }
public override void VisitProperty(IPropertySymbol symbol) { var id = _asOverload ? VisitorHelper.GetOverloadId(symbol.OriginalDefinition) : VisitorHelper.GetId(symbol.OriginalDefinition); ReferenceItem.Parts[SyntaxLanguage.CSharp].Add(new LinkItem { DisplayName = NameVisitorCreator.GetCSharp(NameOptions.WithTypeGenericParameter).GetName(symbol), DisplayNamesWithType = NameVisitorCreator.GetCSharp(NameOptions.WithType | NameOptions.WithTypeGenericParameter).GetName(symbol), DisplayQualifiedNames = NameVisitorCreator.GetCSharp(NameOptions.Qualified | NameOptions.WithTypeGenericParameter).GetName(symbol), Name = id, IsExternalPath = symbol.IsExtern || symbol.DeclaringSyntaxReferences.Length == 0, }); if (symbol.Parameters.Length > 0 && !_asOverload) { ReferenceItem.Parts[SyntaxLanguage.CSharp].Add(new LinkItem { DisplayName = "[", DisplayNamesWithType = "[", DisplayQualifiedNames = "[", }); for (int i = 0; i < symbol.Parameters.Length; i++) { if (i > 0) { ReferenceItem.Parts[SyntaxLanguage.CSharp].Add(new LinkItem { DisplayName = ", ", DisplayNamesWithType = ", ", DisplayQualifiedNames = ", ", }); } symbol.Parameters[i].Type.Accept(this); } ReferenceItem.Parts[SyntaxLanguage.CSharp].Add(new LinkItem { DisplayName = "]", DisplayNamesWithType = "]", DisplayQualifiedNames = "]", }); } }