Skip to content

Commit

Permalink
Merge pull request #1749 from JoeRobich/add-typeparam
Browse files Browse the repository at this point in the history
Add typeparam to description text
  • Loading branch information
filipw authored Mar 26, 2020
2 parents 1b2d4bc + 6d86608 commit 40156eb
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ public static string ConvertDocumentation(string xmlDocumentation, string lineEn
ret.Append(xml["name"]);
ret.Append(" ");
break;
case "typeparam":
ret.Append(lineEnding);
ret.Append("<");
ret.Append(TrimMultiLineString(xml["name"], lineEnding));
ret.Append(">: ");
break;
case "param":
ret.Append(lineEnding);
ret.Append(TrimMultiLineString(xml["name"], lineEnding));
Expand Down
20 changes: 20 additions & 0 deletions tests/OmniSharp.Roslyn.CSharp.Tests/DocumentationConverterFacts.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,5 +57,25 @@ public void Has_correct_spacing_around_paramref()
The arg parameter takes a number and arg2 takes a string.";
Assert.Equal(expected, plainText, ignoreLineEndingDifferences: true);
}

[Fact]
public void Has_typeparam_and_param_in_description()
{
var documentation = @"
<member name=""M:TestNamespace.TestClass.CreateWorkspace`1"">
<summary>
Creates a workspace.
</summary>
<typeparam name=""T"">The type of workspace being created.</typeparam>
<param name=""Path"">The path to the workspace.</param>
</member>";
var plainText = DocumentationConverter.ConvertDocumentation(documentation, "\n");
var expected =
@"Creates a workspace.
<T>: The type of workspace being created.
Path: The path to the workspace.";
Assert.Equal(expected, plainText, ignoreLineEndingDifferences: true);
}
}
}

0 comments on commit 40156eb

Please sign in to comment.