public virtual bool IsArgument <T>(string name, T source) { if (name.EndsWith("Arg")) { return(true); } return(source switch { IPropertySymbol p => p.HasAttribute <ArgumentAttribute>(), IParameterSymbol p => p.HasAttribute <ArgumentAttribute>(), _ => throw new InvalidOperationException("Symbol type not recognized") });
private bool IsOutParameter(IParameterSymbol parameterSymbol) => parameterSymbol.RefKind == RefKind.Out || // Handle VB.NET special case for out parameters (parameterSymbol.RefKind == RefKind.Ref && parameterSymbol.HasAttribute(outAttributeSymbol));