Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add typeparam to description text #1749

Merged
merged 1 commit into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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);
}
}
}