public string FormatCompletion(ReflectionMemberCompletionData completionData, bool includeMethodParameters, SemanticModel model, int filePosition) { if (includeMethodParameters && completionData.ArgumentTypes == null) { throw new ArgumentException("", nameof(includeMethodParameters)); } var parts = new List <string>(); parts.Add(FormatMemberName(completionData.MemberSymbol, model, filePosition)); bool hasBindingFlags = completionData.BindingFlags.Except(new[] { "Public", "Instance" }).Count() > 0; if (hasBindingFlags) // Public | Instance are implicit { parts.Add(FormatBindingFlags(completionData.BindingFlags)); } if (includeMethodParameters) { if (hasBindingFlags) { parts.Add("null"); // have to put Binder here if includes both binding flags and method parameters //parts.Add("CallingConvention.Any"); // this is actualy optional } parts.Add(FormatParameterTypes(completionData.ArgumentTypes, model, filePosition)); if (hasBindingFlags) { parts.Add("null"); } } return(string.Join(", ", parts)); }
public string GetDisplayText(ReflectionMemberCompletionData completionData, SemanticModel model, int filePosition) { return(completionData.MemberSymbol.Name + (completionData.ArgumentTypes == null ? "" : "(" + string.Join(", ", completionData.ArgumentTypes.Select(t => t.ToMinimalDisplayString(model, filePosition))) + ")")); }