8000 Refactor port to triple slash by carlossanlop · Pull Request #164 · dotnet/api-docs-sync · GitHub
[go: up one dir, main page]

Skip to content

Refactor port to triple slash #164

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

Merged
merged 20 commits into from
Sep 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
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
Prev Previous commit
Next Next commit
Adjust and update tests
  • Loading branch information
carlossanlop committed Sep 1, 2023
commit 49ac6151dcd7703abf77742b19b6e08c7ba60afa
Original file line number Diff line number Diff line change
Expand Up @@ -1320,12 +1320,12 @@ public MyClass() { }
{
// Comment on top of type
/// <summary>This is the MyClass type summary.</summary>" +
GetRemarks(skipRemarks, "MyClass type", " ") +
GetRemarks(skipRemarks, "MyClass type", " ") +
@" public class MyClass
{
// Comment on top of constructor
/// <summary>This is the MyClass constructor summary.</summary>" +
GetRemarks(skipRemarks, "MyClass constructor", " ") +
GetRemarks(skipRemarks, "MyClass constructor", " ") +
@" public MyClass() { }
}
}";
Expand All @@ -1338,7 +1338,6 @@ public MyClass() { }
return TestWithStringsAsync(data, skipRemarks);
}

[ActiveIssue("https://github.com/dotnet/api-docs-sync/issues/149")]
[Theory]
[InlineData(false)]
[InlineData(true)]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
using System;
using System;

namespace MyNamespace
{
/// <summary>This is the MyEnum enum summary.</summary>
/// <remarks><format type="text/markdown"><![CDATA[
/// These are the <xref:MyNamespace.MyEnum> enum remarks. They contain an [!INCLUDE[MyInclude](~/includes/MyInclude.md)] which should prevent converting markdown to xml.
/// URL entities: %23%28%2C%29 must remain unconverted.
/// ]]></format></remarks>
// Original MyEnum enum comments with information for maintainers, must stay.
/// <summary>This is the MyEnum enum summary.</summary>
/// <remarks>These are the <see cref="MyNamespace.MyEnum" /> enum remarks. They contain an [!INCLUDE[MyInclude](~/includes/MyInclude.md)] which should prevent converting markdown to xml.
/// URL entities: %23%28%2C%29 must remain unconverted.</remarks>
public enum MyEnum
{
/// <summary>This is the MyEnumValue0 member summary. There is no public modifier.</summary>
Expand All @@ -17,6 +15,7 @@ public enum MyEnum
MyEnumValue1 = 1
}

// Original MyType class comments with information for maintainers, must stay.
/// <summary>This is the MyType class summary.</summary>
/// <remarks>These are the <see cref="MyNamespace.MyType" /> class remarks.
/// URL entities: #(),.
Expand All @@ -27,12 +26,11 @@ public enum MyEnum
/// ]]></format>
/// This text is not a note. It has a <see cref="MyNamespace.MyType" /> that should be xml and outside <b>the cdata</b>.
/// Long xrefs one after the other: <see cref="System.IO.Pipelines.PipeWriter.FlushAsync(System.Threading.CancellationToken)" /> or <see cref="System.IO.Pipelines.PipeWriter.WriteAsync(System.ReadOnlyMemory{byte},System.Threading.CancellationToken)" /> should both be converted to crefs.</remarks>
// Original MyType class comments with information for maintainers, must stay.
public class MyType
{
/// <summary>This is the MyType constructor summary.</summary>
// Original MyType constructor double slash comments on top of triple slash, with information for maintainers, must stay but after triple slash.
// Original MyType constructor double slash comments on bottom of triple slash, with information for maintainers, must stay.
/// <summary>This is the MyType constructor summary.</summary>
public MyType()
{
} /* Trailing comments should remain untouched */
Expand All @@ -51,12 +49,12 @@ internal MyType(int myProperty)
// Double slash comments above private members should remain untouched.
private int _myProperty;

// Original MyProperty property double slash comments with information for maintainers, must stay.
// This particular example has two rows of double slash comments and both should stay.
/// <summary>This is the MyProperty summary.</summary>
/// <value>This is the MyProperty value.</value>
/// <remarks>These are the MyProperty remarks.
/// Multiple lines and a reference to the field <see cref="MyNamespace.MyType.MyField" /> and the xref uses displayProperty, which should be ignored when porting.</remarks>
// Original MyProperty property double slash comments with information for maintainers, must stay.
// This particular example has two rows of double slash comments and both should stay.
public int MyProperty
{
get { return _myProperty; /* Internal comments should remain untouched. */ }
Expand Down Expand Up @@ -139,6 +137,7 @@ public void MyTypeParamMethod<T>(int param1)
{
}

// Original MyDelegate delegate comments with information for maintainers, must stay.
/// <summary>This is the MyDelegate summary.</summary>
/// <param name="sender">This is the sender parameter.</param>
/// <remarks>These are the <see cref="MyNamespace.MyType.MyDelegate" /> remarks. There is a code example, which should be moved to its own examples section:</remarks>
Expand All @@ -153,18 +152,17 @@ public void MyTypeParamMethod<T>(int param1)
/// <seealso cref="System.Delegate"/>
/// <altmember cref="System.Delegate"/>
/// <related type="Article" href="https://github.com/dotnet/runtime">The .NET Runtime repo.</related>
// Original MyDelegate delegate comments with information for maintainers, must stay.
public delegate void MyDelegate(object sender);

/// <summary>This is the MyEvent summary.</summary>
public event MyDelegate MyEvent;

// Original operator + method comments with information for maintainers, must stay.
/// <summary>Adds two MyType instances.</summary>
/// <param name="value1">The first type to add.</param>
/// <param name="value2">The second type to add.</param>
/// <returns>The added types.</returns>
/// <remarks>These are the <see cref="MyNamespace.MyType.op_Addition(MyNamespace.MyType,MyNamespace.MyType)" /> remarks. They are in plain xml and should be transferred unmodified.</remarks>
// Original operator + method comments with information for maintainers, must stay.
public static MyType operator +(MyType value1, MyType value2) => value1;
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
<Type Name="MyGenericType&lt;T&gt;" FullName="MyNamespace.MyGenericType&lt;T&gt;">
<Type Name="MyGenericType&lt;T&gt;" FullName="MyNamespace.MyGenericType&lt;T&gt;">
<TypeSignature Language="DocId" Value="T:MyNamespace.MyGenericType`1" />
<AssemblyInfo>
<AssemblyName>MyAssembly</AssemblyName>
</AssemblyInfo>
<Docs>
<summary>This is the MyGenericType{T} class summary.</summary>
<remarks>
<format type="text/markdown">
<![CDATA[
<format type="text/markdown"><![CDATA[
## Remarks
Contains the nested class <xref:MyNamespace.MyGenericType%601.Enumerator>.
]]></format>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
using System;
using System;

namespace MyNamespace
{
// Original MyGenericType<T> class comments with information for maintainers, must stay.
/// <summary>This is the MyGenericType{T} class summary.</summary>
/// <remarks>Contains the nested class <see cref="MyNamespace.MyGenericType{T}.Enumerator" />.</remarks>
// Original MyGenericType<T> class comments with information for maintainers, must stay.
public class MyGenericType<T>
{
/// <summary>This is the MyGenericType{T}.Enumerator class summary.</summary>
// Original MyGenericType<T>.Enumerator class comments with information for maintainers, must stay.
/// <summary>This is the MyGenericType{T}.Enumerator class summary.</summary>
public class Enumerator { }
}
}
0