|
|
@ -11,7 +11,7 @@ namespace CppSharp.Generators.CSharp |
|
|
|
{ |
|
|
|
{ |
|
|
|
public static void Print(this ITextGenerator textGenerator, Comment comment, CommentKind kind) |
|
|
|
public static void Print(this ITextGenerator textGenerator, Comment comment, CommentKind kind) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var sections = new List<Section> { new Section(CommentElement.Summary) }; |
|
|
|
var sections = new List<Section>(); |
|
|
|
GetCommentSections(comment, sections); |
|
|
|
GetCommentSections(comment, sections); |
|
|
|
foreach (var section in sections) |
|
|
|
foreach (var section in sections) |
|
|
|
TrimSection(section); |
|
|
|
TrimSection(section); |
|
|
@ -23,18 +23,23 @@ namespace CppSharp.Generators.CSharp |
|
|
|
switch (comment.Kind) |
|
|
|
switch (comment.Kind) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case DocumentationCommentKind.FullComment: |
|
|
|
case DocumentationCommentKind.FullComment: |
|
|
|
var fullComment = (FullComment)comment; |
|
|
|
{ |
|
|
|
foreach (var block in fullComment.Blocks) |
|
|
|
foreach (var block in ((FullComment)comment).Blocks) |
|
|
|
block.GetCommentSections(sections); |
|
|
|
block.GetCommentSections(sections); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
case DocumentationCommentKind.BlockCommandComment: |
|
|
|
case DocumentationCommentKind.BlockCommandComment: |
|
|
|
|
|
|
|
{ |
|
|
|
var blockCommandComment = (BlockCommandComment)comment; |
|
|
|
var blockCommandComment = (BlockCommandComment)comment; |
|
|
|
if (blockCommandComment.ParagraphComment == null) |
|
|
|
if (blockCommandComment.ParagraphComment == null) |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
|
|
|
|
switch (blockCommandComment.CommandKind) |
|
|
|
switch (blockCommandComment.CommandKind) |
|
|
|
{ |
|
|
|
{ |
|
|
|
case CommentCommandKind.Brief: |
|
|
|
case CommentCommandKind.Brief: |
|
|
|
|
|
|
|
sections.Add(new Section(CommentElement.Summary)); |
|
|
|
blockCommandComment.ParagraphComment.GetCommentSections(sections); |
|
|
|
blockCommandComment.ParagraphComment.GetCommentSections(sections); |
|
|
|
|
|
|
|
sections.Add(new Section(CommentElement.Remarks)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case CommentCommandKind.Return: |
|
|
|
case CommentCommandKind.Return: |
|
|
|
case CommentCommandKind.Returns: |
|
|
|
case CommentCommandKind.Returns: |
|
|
@ -49,6 +54,7 @@ namespace CppSharp.Generators.CSharp |
|
|
|
if (inlineContentComment.HasTrailingNewline) |
|
|
|
if (inlineContentComment.HasTrailingNewline) |
|
|
|
lastBlockSection.NewLine(); |
|
|
|
lastBlockSection.NewLine(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
default: |
|
|
|
default: |
|
|
|
sections.Add(new Section(CommentElement.Remarks)); |
|
|
|
sections.Add(new Section(CommentElement.Remarks)); |
|
|
@ -56,67 +62,79 @@ namespace CppSharp.Generators.CSharp |
|
|
|
break; |
|
|
|
break; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
case DocumentationCommentKind.ParamCommandComment: |
|
|
|
case DocumentationCommentKind.ParamCommandComment: |
|
|
|
|
|
|
|
{ |
|
|
|
var paramCommandComment = (ParamCommandComment)comment; |
|
|
|
var paramCommandComment = (ParamCommandComment)comment; |
|
|
|
var param = new Section(CommentElement.Param); |
|
|
|
var param = new Section(CommentElement.Param); |
|
|
|
sections.Add(param); |
|
|
|
sections.Add(param); |
|
|
|
if (paramCommandComment.Arguments.Count > 0) |
|
|
|
if (paramCommandComment.Arguments.Count > 0) |
|
|
|
param.Attributes.Add( |
|
|
|
param.Attributes.Add($"name=\"{paramCommandComment.Arguments[0].Text}\""); |
|
|
|
string.Format("name=\"{0}\"", paramCommandComment.Arguments[0].Text)); |
|
|
|
|
|
|
|
if (paramCommandComment.ParagraphComment != null) |
|
|
|
if (paramCommandComment.ParagraphComment != null) |
|
|
|
|
|
|
|
{ |
|
|
|
foreach (var inlineContentComment in paramCommandComment.ParagraphComment.Content) |
|
|
|
foreach (var inlineContentComment in paramCommandComment.ParagraphComment.Content) |
|
|
|
{ |
|
|
|
{ |
|
|
|
inlineContentComment.GetCommentSections(sections); |
|
|
|
inlineContentComment.GetCommentSections(sections); |
|
|
|
if (inlineContentComment.HasTrailingNewline) |
|
|
|
if (inlineContentComment.HasTrailingNewline) |
|
|
|
sections.Last().NewLine(); |
|
|
|
sections.Last().NewLine(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(sections.Last().CurrentLine.ToString())) |
|
|
|
if (!string.IsNullOrEmpty(sections.Last().CurrentLine.ToString())) |
|
|
|
sections.Add(new Section(CommentElement.Remarks)); |
|
|
|
sections.Add(new Section(CommentElement.Remarks)); |
|
|
|
break; |
|
|
|
break; |
|
|
|
case DocumentationCommentKind.TParamCommandComment: |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
case DocumentationCommentKind.VerbatimBlockComment: |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case DocumentationCommentKind.VerbatimLineComment: |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case DocumentationCommentKind.ParagraphComment: |
|
|
|
case DocumentationCommentKind.ParagraphComment: |
|
|
|
var summaryParagraph = sections.Count == 1; |
|
|
|
{ |
|
|
|
var paragraphComment = (ParagraphComment)comment; |
|
|
|
bool assumeSummary = false; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (sections.Count == 0) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
assumeSummary = true; |
|
|
|
|
|
|
|
sections.Add(new Section(CommentElement.Summary)); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
var lastParagraphSection = sections.Last(); |
|
|
|
var lastParagraphSection = sections.Last(); |
|
|
|
|
|
|
|
var paragraphComment = (ParagraphComment)comment; |
|
|
|
foreach (var inlineContentComment in paragraphComment.Content) |
|
|
|
foreach (var inlineContentComment in paragraphComment.Content) |
|
|
|
{ |
|
|
|
{ |
|
|
|
inlineContentComment.GetCommentSections(sections); |
|
|
|
inlineContentComment.GetCommentSections(sections); |
|
|
|
if (inlineContentComment.HasTrailingNewline) |
|
|
|
if (inlineContentComment.HasTrailingNewline) |
|
|
|
lastParagraphSection.NewLine(); |
|
|
|
lastParagraphSection.NewLine(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var newSection = sections.Last(); |
|
|
|
|
|
|
|
if (lastParagraphSection == newSection) |
|
|
|
|
|
|
|
continue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(lastParagraphSection.CurrentLine.ToString())) |
|
|
|
|
|
|
|
lastParagraphSection.NewLine(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
lastParagraphSection = newSection; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
if (!string.IsNullOrEmpty(lastParagraphSection.CurrentLine.ToString())) |
|
|
|
if (!string.IsNullOrEmpty(lastParagraphSection.CurrentLine.ToString())) |
|
|
|
lastParagraphSection.NewLine(); |
|
|
|
lastParagraphSection.NewLine(); |
|
|
|
|
|
|
|
|
|
|
|
if (sections[0].GetLines().Count > 0 && summaryParagraph) |
|
|
|
// The next paragraph should be a remarks section
|
|
|
|
{ |
|
|
|
if (assumeSummary) |
|
|
|
sections[0].GetLines().AddRange(sections.Skip(1).SelectMany(s => s.GetLines())); |
|
|
|
|
|
|
|
sections.RemoveRange(1, sections.Count - 1); |
|
|
|
|
|
|
|
sections.Add(new Section(CommentElement.Remarks)); |
|
|
|
sections.Add(new Section(CommentElement.Remarks)); |
|
|
|
} |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case DocumentationCommentKind.HTMLTagComment: |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case DocumentationCommentKind.HTMLStartTagComment: |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case DocumentationCommentKind.HTMLEndTagComment: |
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
case DocumentationCommentKind.TextComment: |
|
|
|
case DocumentationCommentKind.TextComment: |
|
|
|
var lastTextsection = sections.Last(); |
|
|
|
{ |
|
|
|
lastTextsection.CurrentLine.Append(GetText(comment, |
|
|
|
var lastTextSection = sections.Last(); |
|
|
|
lastTextsection.Type == CommentElement.Returns || |
|
|
|
lastTextSection.CurrentLine |
|
|
|
lastTextsection.Type == CommentElement.Param).Trim()); |
|
|
|
.Append( |
|
|
|
break; |
|
|
|
GetText(comment, lastTextSection.Type is CommentElement.Returns or CommentElement.Param) |
|
|
|
case DocumentationCommentKind.InlineContentComment: |
|
|
|
.TrimStart() |
|
|
|
|
|
|
|
); |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
case DocumentationCommentKind.InlineCommandComment: |
|
|
|
case DocumentationCommentKind.InlineCommandComment: |
|
|
|
|
|
|
|
{ |
|
|
|
var lastInlineSection = sections.Last(); |
|
|
|
var lastInlineSection = sections.Last(); |
|
|
|
var inlineCommand = (InlineCommandComment)comment; |
|
|
|
var inlineCommand = (InlineCommandComment)comment; |
|
|
|
|
|
|
|
|
|
|
@ -125,9 +143,50 @@ namespace CppSharp.Generators.CSharp |
|
|
|
var argText = $" <c>{inlineCommand.Arguments[0].Text}</c> "; |
|
|
|
var argText = $" <c>{inlineCommand.Arguments[0].Text}</c> "; |
|
|
|
lastInlineSection.CurrentLine.Append(argText); |
|
|
|
lastInlineSection.CurrentLine.Append(argText); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case DocumentationCommentKind.HTMLStartTagComment: |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var startTag = (HTMLStartTagComment)comment; |
|
|
|
|
|
|
|
var sectionType = CommentElementFromTag(startTag.TagName); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (IsInlineCommentElement(sectionType)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var lastSection = sections.Last(); |
|
|
|
|
|
|
|
lastSection.CurrentLine.Append(startTag); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sections.Add(new Section(sectionType) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
Attributes = startTag.Attributes.Select(a => a.ToString()).ToList() |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case DocumentationCommentKind.HTMLEndTagComment: |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var endTag = (HTMLEndTagComment)comment; |
|
|
|
|
|
|
|
var sectionType = CommentElementFromTag(endTag.TagName); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (IsInlineCommentElement(sectionType)) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
var lastSection = sections.Last(); |
|
|
|
|
|
|
|
lastSection.CurrentLine.Append(endTag); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case DocumentationCommentKind.HTMLTagComment: |
|
|
|
|
|
|
|
case DocumentationCommentKind.TParamCommandComment: |
|
|
|
|
|
|
|
case DocumentationCommentKind.VerbatimBlockComment: |
|
|
|
|
|
|
|
case DocumentationCommentKind.VerbatimLineComment: |
|
|
|
|
|
|
|
case DocumentationCommentKind.InlineContentComment: |
|
|
|
case DocumentationCommentKind.VerbatimBlockLineComment: |
|
|
|
case DocumentationCommentKind.VerbatimBlockLineComment: |
|
|
|
|
|
|
|
case DocumentationCommentKind.BlockContentComment: |
|
|
|
break; |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
throw new ArgumentOutOfRangeException(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -139,10 +198,10 @@ namespace CppSharp.Generators.CSharp |
|
|
|
text = text.Trim(); |
|
|
|
text = text.Trim(); |
|
|
|
|
|
|
|
|
|
|
|
if (Helpers.RegexTag.IsMatch(text)) |
|
|
|
if (Helpers.RegexTag.IsMatch(text)) |
|
|
|
return String.Empty; |
|
|
|
return string.Empty; |
|
|
|
|
|
|
|
|
|
|
|
return HtmlEncoder.HtmlEncode( |
|
|
|
return HtmlEncoder.HtmlEncode( |
|
|
|
text.Length > 1 && text[0] == ' ' && text[1] != ' ' ? text.Substring(1) : text); |
|
|
|
text.Length > 1 && text[0] == ' ' && text[1] != ' ' ? text[1..] : text); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private static void TrimSection(Section section) |
|
|
|
private static void TrimSection(Section section) |
|
|
@ -166,22 +225,25 @@ namespace CppSharp.Generators.CSharp |
|
|
|
|
|
|
|
|
|
|
|
private static void FormatComment(ITextGenerator textGenerator, List<Section> sections, CommentKind kind) |
|
|
|
private static void FormatComment(ITextGenerator textGenerator, List<Section> sections, CommentKind kind) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var commentPrefix = Comment.GetMultiLineCommentPrologue(kind); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sections.Sort((x, y) => x.Type.CompareTo(y.Type)); |
|
|
|
sections.Sort((x, y) => x.Type.CompareTo(y.Type)); |
|
|
|
|
|
|
|
|
|
|
|
var remarks = sections.Where(s => s.Type == CommentElement.Remarks).ToList(); |
|
|
|
var remarks = sections.Where(s => s.Type == CommentElement.Remarks).ToList(); |
|
|
|
if (remarks.Any()) |
|
|
|
if (remarks.Count != 0) |
|
|
|
remarks.First().GetLines().AddRange(remarks.Skip(1).SelectMany(s => s.GetLines())); |
|
|
|
remarks.First().GetLines().AddRange(remarks.Skip(1).SelectMany(s => s.GetLines())); |
|
|
|
|
|
|
|
|
|
|
|
if (remarks.Count > 1) |
|
|
|
if (remarks.Count > 1) |
|
|
|
sections.RemoveRange(sections.IndexOf(remarks.First()) + 1, remarks.Count - 1); |
|
|
|
sections.RemoveRange(sections.IndexOf(remarks.First()) + 1, remarks.Count - 1); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var commentPrefix = Comment.GetMultiLineCommentPrologue(kind); |
|
|
|
foreach (var section in sections.Where(s => s.HasLines)) |
|
|
|
foreach (var section in sections.Where(s => s.HasLines)) |
|
|
|
{ |
|
|
|
{ |
|
|
|
var lines = section.GetLines(); |
|
|
|
var lines = section.GetLines(); |
|
|
|
var tag = section.Type.ToString().ToLowerInvariant(); |
|
|
|
var tag = section.Type.ToString().ToLowerInvariant(); |
|
|
|
|
|
|
|
|
|
|
|
var attributes = string.Empty; |
|
|
|
var attributes = string.Empty; |
|
|
|
if (section.Attributes.Any()) |
|
|
|
if (section.Attributes.Count != 0) |
|
|
|
attributes = ' ' + string.Join(" ", section.Attributes); |
|
|
|
attributes = ' ' + string.Join(" ", section.Attributes); |
|
|
|
|
|
|
|
|
|
|
|
textGenerator.Write($"{commentPrefix} <{tag}{attributes}>"); |
|
|
|
textGenerator.Write($"{commentPrefix} <{tag}{attributes}>"); |
|
|
|
if (lines.Count == 1) |
|
|
|
if (lines.Count == 1) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -205,13 +267,13 @@ namespace CppSharp.Generators.CSharp |
|
|
|
Type = type; |
|
|
|
Type = type; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public StringBuilder CurrentLine { get; set; } = new StringBuilder(); |
|
|
|
public StringBuilder CurrentLine { get; set; } = new(); |
|
|
|
|
|
|
|
|
|
|
|
public CommentElement Type { get; set; } |
|
|
|
public CommentElement Type { get; set; } |
|
|
|
|
|
|
|
|
|
|
|
public List<string> Attributes { get; } = new List<string>(); |
|
|
|
public List<string> Attributes { get; init; } = new(); |
|
|
|
|
|
|
|
|
|
|
|
private List<string> lines { get; } = new List<string>(); |
|
|
|
private List<string> lines { get; } = new(); |
|
|
|
|
|
|
|
|
|
|
|
public bool HasLines => lines.Any(); |
|
|
|
public bool HasLines => lines.Any(); |
|
|
|
|
|
|
|
|
|
|
@ -229,15 +291,71 @@ namespace CppSharp.Generators.CSharp |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static CommentElement CommentElementFromTag(string tag) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return tag.ToLowerInvariant() switch |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
"c" => CommentElement.C, |
|
|
|
|
|
|
|
"code" => CommentElement.Code, |
|
|
|
|
|
|
|
"example" => CommentElement.Example, |
|
|
|
|
|
|
|
"exception" => CommentElement.Exception, |
|
|
|
|
|
|
|
"include" => CommentElement.Include, |
|
|
|
|
|
|
|
"list" => CommentElement.List, |
|
|
|
|
|
|
|
"para" => CommentElement.Para, |
|
|
|
|
|
|
|
"param" => CommentElement.Param, |
|
|
|
|
|
|
|
"paramref" => CommentElement.ParamRef, |
|
|
|
|
|
|
|
"permission" => CommentElement.Permission, |
|
|
|
|
|
|
|
"remarks" => CommentElement.Remarks, |
|
|
|
|
|
|
|
"return" or "returns" => CommentElement.Returns, |
|
|
|
|
|
|
|
"summary" => CommentElement.Summary, |
|
|
|
|
|
|
|
"typeparam" => CommentElement.TypeParam, |
|
|
|
|
|
|
|
"typeparamref" => CommentElement.TypeParamRef, |
|
|
|
|
|
|
|
"value" => CommentElement.Value, |
|
|
|
|
|
|
|
"seealso" => CommentElement.SeeAlso, |
|
|
|
|
|
|
|
"see" => CommentElement.See, |
|
|
|
|
|
|
|
"inheritdoc" => CommentElement.InheritDoc, |
|
|
|
|
|
|
|
_ => CommentElement.Unknown |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>From https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/documentation-comments#d3-recommended-tags</summary>
|
|
|
|
|
|
|
|
/// <remarks>Enum value is equal to sorting priority</remarks>
|
|
|
|
private enum CommentElement |
|
|
|
private enum CommentElement |
|
|
|
{ |
|
|
|
{ |
|
|
|
Summary, |
|
|
|
C = 1000, // Set text in a code-like font
|
|
|
|
Typeparam, |
|
|
|
Code = 1001, // Set one or more lines of source code or program output
|
|
|
|
Param, |
|
|
|
Example = 11, // Indicate an example
|
|
|
|
Returns, |
|
|
|
Exception = 8, // Identifies the exceptions a method can throw
|
|
|
|
Exception, |
|
|
|
Include = 1, // Includes XML from an external file
|
|
|
|
Remarks, |
|
|
|
List = 1002, // Create a list or table
|
|
|
|
Example |
|
|
|
Para = 1003, // Permit structure to be added to text
|
|
|
|
|
|
|
|
Param = 5, // Describe a parameter for a method or constructor
|
|
|
|
|
|
|
|
ParamRef = 1004, // Identify that a word is a parameter name
|
|
|
|
|
|
|
|
Permission = 7, // Document the security accessibility of a member
|
|
|
|
|
|
|
|
Remarks = 9, // Describe additional information about a type
|
|
|
|
|
|
|
|
Returns = 6, // Describe the return value of a method
|
|
|
|
|
|
|
|
See = 1005, // Specify a link
|
|
|
|
|
|
|
|
SeeAlso = 10, // Generate a See Also entry
|
|
|
|
|
|
|
|
Summary = 2, // Describe a type or a member of a type
|
|
|
|
|
|
|
|
TypeParam = 4, // Describe a type parameter for a generic type or method
|
|
|
|
|
|
|
|
TypeParamRef = 1006, // Identify that a word is a type parameter name
|
|
|
|
|
|
|
|
Value = 3, // Describe a property
|
|
|
|
|
|
|
|
InheritDoc = 0, // Inherit documentation from a base class
|
|
|
|
|
|
|
|
Unknown = 9999, // Unknown tag
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private static bool IsInlineCommentElement(CommentElement element) => |
|
|
|
|
|
|
|
element switch |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
CommentElement.C => true, |
|
|
|
|
|
|
|
CommentElement.Code => true, |
|
|
|
|
|
|
|
CommentElement.List => true, |
|
|
|
|
|
|
|
CommentElement.Para => true, |
|
|
|
|
|
|
|
CommentElement.ParamRef => true, |
|
|
|
|
|
|
|
CommentElement.See => true, |
|
|
|
|
|
|
|
CommentElement.TypeParamRef => true, |
|
|
|
|
|
|
|
CommentElement.Unknown => true, // Print unknown tags as inline
|
|
|
|
|
|
|
|
_ => ((int)element) >= 1000 |
|
|
|
|
|
|
|
}; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|