示例#1
0
        public static string CreateSignatureMarkdown(AbstractType t, bool templateParamCompletion = false, int currentMethodParam = -1)
        {
            var markupGen = new TooltipMarkupGen();
            var sb        = new StringBuilder();

            sb.AppendLine(markupGen.GenTooltipSignature(t, templateParamCompletion, currentMethodParam));

            if (t is DSymbol ds && ds.Definition is { } n)
            {
                AppendTooltipBody(markupGen, n, sb);
            }

            return(sb.ToString());
        }
示例#2
0
        static void AppendTooltipBody(TooltipMarkupGen markupGen, DNode dn, StringBuilder sb)
        {
            markupGen.GenToolTipBody(dn, out string summary, out Dictionary <string, string> categories);

            if (summary != null)
            {
                sb.AppendLine();
                sb.AppendLine(summary);
            }

            if (categories != null)
            {
                sb.AppendLine();
                foreach (var kv in categories)
                {
                    sb.Append("**").Append(kv.Key).Append(":** ").AppendLine(kv.Value);
                }
            }
        }