From d4451f94b436a52a75d569080807f08d38e570b0 Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Thu, 9 Jul 2020 16:11:18 +0800 Subject: [PATCH 01/18] Added C++ WINRT attribute formatter. --- .../CppWinRtAttributeFormatter.cs | 15 +++++++++++++++ .../Updater/Formatters/FormatterManager.cs | 1 + mdoc/mdoc.csproj | 1 + 3 files changed, 17 insertions(+) create mode 100644 mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs diff --git a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs new file mode 100644 index 000000000..10e481c9f --- /dev/null +++ b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs @@ -0,0 +1,15 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace Mono.Documentation.Updater.Formatters +{ + class CppWinRtAttributeFormatter : AttributeFormatter + { + public override string PrefixBrackets { get; } = "["; + public override string SurfixBrackets { get; } = "]"; + public override string Language => Consts.CppWinRt; + } +} diff --git a/mdoc/Mono.Documentation/Updater/Formatters/FormatterManager.cs b/mdoc/Mono.Documentation/Updater/Formatters/FormatterManager.cs index a447065a8..c5a963182 100644 --- a/mdoc/Mono.Documentation/Updater/Formatters/FormatterManager.cs +++ b/mdoc/Mono.Documentation/Updater/Formatters/FormatterManager.cs @@ -51,6 +51,7 @@ public static void AddFormatter(string langId) case Consts.CppWinRtLowCase: TypeFormatters.Add(new CppWinRtMemberFormatter(map)); MemberFormatters.Add(new CppWinRtFullMemberFormatter(map)); + AdditionalAttributeFormatters.Add(new CppWinRtAttributeFormatter()); break; case Consts.FSharpLowCase: case "fsharp": diff --git a/mdoc/mdoc.csproj b/mdoc/mdoc.csproj index 6dbeae52f..29314adb3 100644 --- a/mdoc/mdoc.csproj +++ b/mdoc/mdoc.csproj @@ -58,6 +58,7 @@ + From 8ee5286195d51378868b0931bb702ffe8818894b Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Wed, 15 Jul 2020 10:27:14 +0800 Subject: [PATCH 02/18] Changed integration tests for C++ WINRT. --- mdoc/Test/ClassEnumeratorECMA.xml | 1 + mdoc/Test/TestEcmaDocs.xml | 4 ++++ .../Mono.DocTest.Generic/Func`2.xml | 5 +++++ .../Mono.DocTest.Generic/GenericBase`1.xml | 1 + .../Mono.DocTest.Generic/MyList`1.xml | 1 + .../Mono.DocTest/DocAttribute.xml | 1 + .../Mono.DocTest/Widget+Direction.xml | 1 + .../Mono.DocTest/Widget.xml | 16 ++++++++++++++++ .../CustomNamespace/ClassEnumerator.xml | 1 + .../CustomNamespace/ClassEnumerator.xml | 1 + .../CustomNamespace/ClassEnumerator.xml | 1 + .../en.expected/Mono.DocTest.Generic/Func`2.xml | 5 +++++ .../Mono.DocTest.Generic/GenericBase`1.xml | 1 + .../Mono.DocTest.Generic/MyList`1.xml | 1 + .../Namespace2/Class2.xml | 5 +++++ .../Namespace2/Class3.xml | 4 ++++ .../Namespace2/Class4.xml | 1 + .../ex.expected-cppwinrtuwp/Namespace222/App.xml | 5 +++++ .../UwpTestWinRtComponentCpp/Class1.xml | 5 +++++ .../UwpTestWinRtComponentCpp/Color1.xml | 1 + .../CustomAttribute1.xml | 2 ++ .../PrimeFoundHandler.xml | 2 ++ .../PrimeFoundHandlerWithSpecificType.xml | 2 ++ .../SomethingHappenedEventHandler.xml | 2 ++ mdoc/Test/test-multiple-mdoc/Widget.xml | 5 +++++ .../Mono.DocTest/Widget.xml | 5 +++++ 26 files changed, 79 insertions(+) diff --git a/mdoc/Test/ClassEnumeratorECMA.xml b/mdoc/Test/ClassEnumeratorECMA.xml index 5b98cedd9..8fe135fd5 100644 --- a/mdoc/Test/ClassEnumeratorECMA.xml +++ b/mdoc/Test/ClassEnumeratorECMA.xml @@ -106,6 +106,7 @@ [System.STAThread] [<System.STAThread>] + [System.STAThread] diff --git a/mdoc/Test/TestEcmaDocs.xml b/mdoc/Test/TestEcmaDocs.xml index 225b2208c..be44622fa 100644 --- a/mdoc/Test/TestEcmaDocs.xml +++ b/mdoc/Test/TestEcmaDocs.xml @@ -19,6 +19,7 @@ [CLSCompliantAttribute(true)] [<CLSCompliantAttribute(true)>] + [CLSCompliantAttribute(true)] 0 @@ -61,6 +62,7 @@ [CLSCompliantAttribute(true)] [<CLSCompliantAttribute(true)>] + [CLSCompliantAttribute(true)] 0 @@ -96,6 +98,7 @@ [CLSCompliantAttribute(true)] [<CLSCompliantAttribute(true)>] + [CLSCompliantAttribute(true)] 0 @@ -194,6 +197,7 @@ [CLSCompliantAttribute(true)] [<CLSCompliantAttribute(true)>] + [CLSCompliantAttribute(true)] 0 diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/Func`2.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/Func`2.xml index c30d9caaa..59476c867 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/Func`2.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/Func`2.xml @@ -10,6 +10,7 @@ [Mono.DocTest.Doc("arg!")] + [Mono.DocTest.Doc("arg!")] @@ -21,6 +22,7 @@ [Mono.DocTest.Doc("ret!")] + [Mono.DocTest.Doc("ret!")] @@ -34,6 +36,7 @@ [Mono.DocTest.Doc("method")] + [Mono.DocTest.Doc("method")] @@ -41,6 +44,7 @@ [Mono.DocTest.Doc("arg-actual")] + [Mono.DocTest.Doc("arg-actual")] @@ -50,6 +54,7 @@ [Mono.DocTest.Doc("return", Field=false)] + [Mono.DocTest.Doc("return", Field=false)] diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/GenericBase`1.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/GenericBase`1.xml index b66705322..b2df26c89 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/GenericBase`1.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/GenericBase`1.xml @@ -49,6 +49,7 @@ [Mono.DocTest.Doc("S")] + [Mono.DocTest.Doc("S")] diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/MyList`1.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/MyList`1.xml index 9d989ab08..7b468f5a0 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/MyList`1.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/MyList`1.xml @@ -10,6 +10,7 @@ [Mono.DocTest.Doc("Type Parameter!")] + [Mono.DocTest.Doc("Type Parameter!")] diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/DocAttribute.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/DocAttribute.xml index c0d0584fb..b9b3e36e8 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/DocAttribute.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/DocAttribute.xml @@ -12,6 +12,7 @@ [System.AttributeUsage(System.AttributeTargets.All)] + [System.AttributeUsage(System.AttributeTargets.All)] diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget+Direction.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget+Direction.xml index 2a8351199..107f4a0ba 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget+Direction.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget+Direction.xml @@ -12,6 +12,7 @@ [System.Flags] + [System.Flags] diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml index e8509ce58..37e6b1f3f 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml @@ -77,12 +77,15 @@ [Mono.DocTest.Doc("Del event")] + [Mono.DocTest.Doc("Del event")] [add: Mono.DocTest.Doc("Del add accessor")] + [add: Mono.DocTest.Doc("Del add accessor")] [remove: Mono.DocTest.Doc("Del remove accessor")] + [remove: Mono.DocTest.Doc("Del remove accessor")] @@ -311,6 +314,7 @@ [System.Obsolete("why not")] + [System.Obsolete("why not")] @@ -380,6 +384,7 @@ [Mono.DocTest.Doc("Height property")] + [Mono.DocTest.Doc("Height property")] @@ -402,9 +407,11 @@ [Mono.DocTest.Doc("Item property")] + [Mono.DocTest.Doc("Item property")] [set: Mono.DocTest.Doc("Item property set accessor")] + [set: Mono.DocTest.Doc("Item property set accessor")] @@ -471,6 +478,7 @@ [Mono.DocTest.Doc("normal DocAttribute", Field=true)] + [Mono.DocTest.Doc("normal DocAttribute", Field=true)] @@ -478,6 +486,7 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] + [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] @@ -486,6 +495,7 @@ [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] + [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] @@ -493,6 +503,7 @@ [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] + [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] @@ -500,6 +511,7 @@ [Mono.DocTest.Doc("v")] + [Mono.DocTest.Doc("v")] @@ -618,6 +630,7 @@ [System.ParamArray] + [System.ParamArray] @@ -843,12 +856,15 @@ [Mono.DocTest.Doc("Width property")] + [Mono.DocTest.Doc("Width property")] [get: Mono.DocTest.Doc("Width get accessor")] + [get: Mono.DocTest.Doc("Width get accessor")] [set: Mono.DocTest.Doc("Width set accessor")] + [set: Mono.DocTest.Doc("Width set accessor")] diff --git a/mdoc/Test/en.expected-eii-implementation-ecmadoc/CustomNamespace/ClassEnumerator.xml b/mdoc/Test/en.expected-eii-implementation-ecmadoc/CustomNamespace/ClassEnumerator.xml index 5bd123c78..6492c683f 100644 --- a/mdoc/Test/en.expected-eii-implementation-ecmadoc/CustomNamespace/ClassEnumerator.xml +++ b/mdoc/Test/en.expected-eii-implementation-ecmadoc/CustomNamespace/ClassEnumerator.xml @@ -101,6 +101,7 @@ [System.STAThread] [<System.STAThread>] + [System.STAThread] diff --git a/mdoc/Test/en.expected-eii-implementation-slashdoc/CustomNamespace/ClassEnumerator.xml b/mdoc/Test/en.expected-eii-implementation-slashdoc/CustomNamespace/ClassEnumerator.xml index 822074f9f..8e4c5a50f 100644 --- a/mdoc/Test/en.expected-eii-implementation-slashdoc/CustomNamespace/ClassEnumerator.xml +++ b/mdoc/Test/en.expected-eii-implementation-slashdoc/CustomNamespace/ClassEnumerator.xml @@ -105,6 +105,7 @@ [System.STAThread] [<System.STAThread>] + [System.STAThread] diff --git a/mdoc/Test/en.expected-eii-implementation/CustomNamespace/ClassEnumerator.xml b/mdoc/Test/en.expected-eii-implementation/CustomNamespace/ClassEnumerator.xml index 9070f4185..f7ed1410b 100644 --- a/mdoc/Test/en.expected-eii-implementation/CustomNamespace/ClassEnumerator.xml +++ b/mdoc/Test/en.expected-eii-implementation/CustomNamespace/ClassEnumerator.xml @@ -101,6 +101,7 @@ [System.STAThread] [<System.STAThread>] + [System.STAThread] diff --git a/mdoc/Test/en.expected/Mono.DocTest.Generic/Func`2.xml b/mdoc/Test/en.expected/Mono.DocTest.Generic/Func`2.xml index 42e4e596c..809dcbc41 100644 --- a/mdoc/Test/en.expected/Mono.DocTest.Generic/Func`2.xml +++ b/mdoc/Test/en.expected/Mono.DocTest.Generic/Func`2.xml @@ -15,6 +15,7 @@ [Mono.DocTest.Doc("arg!")] [<Mono.DocTest.Doc("arg!")>] + [Mono.DocTest.Doc("arg!")] @@ -27,6 +28,7 @@ [Mono.DocTest.Doc("ret!")] [<Mono.DocTest.Doc("ret!")>] + [Mono.DocTest.Doc("ret!")] @@ -41,6 +43,7 @@ [Mono.DocTest.Doc("method")] [<Mono.DocTest.Doc("method")>] + [Mono.DocTest.Doc("method")] @@ -49,6 +52,7 @@ [Mono.DocTest.Doc("arg-actual")] [<Mono.DocTest.Doc("arg-actual")>] + [Mono.DocTest.Doc("arg-actual")] @@ -59,6 +63,7 @@ [Mono.DocTest.Doc("return", Field=false)] [<Mono.DocTest.Doc("return", Field=false)>] + [Mono.DocTest.Doc("return", Field=false)] diff --git a/mdoc/Test/en.expected/Mono.DocTest.Generic/GenericBase`1.xml b/mdoc/Test/en.expected/Mono.DocTest.Generic/GenericBase`1.xml index 6134d6f32..f50480de8 100644 --- a/mdoc/Test/en.expected/Mono.DocTest.Generic/GenericBase`1.xml +++ b/mdoc/Test/en.expected/Mono.DocTest.Generic/GenericBase`1.xml @@ -63,6 +63,7 @@ [Mono.DocTest.Doc("S")] [<Mono.DocTest.Doc("S")>] + [Mono.DocTest.Doc("S")] diff --git a/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml b/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml index 96840054d..a47bc7cb9 100644 --- a/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml +++ b/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml @@ -15,6 +15,7 @@ [Mono.DocTest.Doc("Type Parameter!")] [<Mono.DocTest.Doc("Type Parameter!")>] + [Mono.DocTest.Doc("Type Parameter!")] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class2.xml b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class2.xml index d3950d522..46af32a2e 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class2.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class2.xml @@ -13,18 +13,23 @@ [Windows.Foundation.Metadata.Composable(typeof(Namespace2.__IClass2ProtectedFactory), Windows.Foundation.Metadata.CompositionType.Protected, 1)] + [Windows.Foundation.Metadata.Composable(Namespace2.__IClass2ProtectedFactory, Windows.Foundation.Metadata.CompositionType.Protected, 1)] [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] + [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] + [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] [Windows.Foundation.Metadata.Version(1)] + [Windows.Foundation.Metadata.Version(1)] [Windows.Foundation.Metadata.WebHostHidden] + [Windows.Foundation.Metadata.WebHostHidden] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class3.xml b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class3.xml index a0a2e3b24..eaa9b3a81 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class3.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class3.xml @@ -13,15 +13,19 @@ [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] + [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] + [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] [Windows.Foundation.Metadata.Version(1)] + [Windows.Foundation.Metadata.Version(1)] [Windows.Foundation.Metadata.WebHostHidden] + [Windows.Foundation.Metadata.WebHostHidden] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class4.xml b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class4.xml index cf267926f..862bf887a 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class4.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class4.xml @@ -13,6 +13,7 @@ [Windows.Foundation.Metadata.Version(1)] + [Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace222/App.xml b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace222/App.xml index 4c718bd6d..8ae46ee47 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace222/App.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace222/App.xml @@ -17,15 +17,19 @@ [Windows.Foundation.Metadata.Activatable(1)] + [Windows.Foundation.Metadata.Activatable(1)] [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] + [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] + [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] [Windows.Foundation.Metadata.Version(1)] + [Windows.Foundation.Metadata.Version(1)] @@ -44,6 +48,7 @@ [Windows.Foundation.Metadata.Overload("CreateInstance1")] + [Windows.Foundation.Metadata.Overload("CreateInstance1")] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Class1.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Class1.xml index f7099bffa..21e89e565 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Class1.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Class1.xml @@ -13,15 +13,19 @@ [Windows.Foundation.Metadata.Activatable(1)] + [Windows.Foundation.Metadata.Activatable(1)] [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] + [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] + [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] [Windows.Foundation.Metadata.Version(1)] + [Windows.Foundation.Metadata.Version(1)] @@ -40,6 +44,7 @@ [Windows.Foundation.Metadata.Overload("CreateInstance1")] + [Windows.Foundation.Metadata.Overload("CreateInstance1")] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Color1.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Color1.xml index b8bdd3f83..b72391ba3 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Color1.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Color1.xml @@ -12,6 +12,7 @@ [Windows.Foundation.Metadata.Version(1)] + [Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/CustomAttribute1.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/CustomAttribute1.xml index f556352d5..efd5a278b 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/CustomAttribute1.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/CustomAttribute1.xml @@ -12,6 +12,7 @@ [Windows.Foundation.Metadata.Version(1)] + [Windows.Foundation.Metadata.Version(1)] @@ -30,6 +31,7 @@ [Windows.Foundation.Metadata.Overload("CreateInstance1")] + [Windows.Foundation.Metadata.Overload("CreateInstance1")] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandler.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandler.xml index a03cc97e8..5fca9c150 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandler.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandler.xml @@ -11,9 +11,11 @@ [Windows.Foundation.Metadata.Guid(1538629431, 28309, 13279, 150, 105, 205, 62, 250, 110, 149, 1)] + [Windows.Foundation.Metadata.Guid(1538629431, 28309, 13279, 150, 105, 205, 62, 250, 110, 149, 1)] [Windows.Foundation.Metadata.Version(1)] + [Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandlerWithSpecificType.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandlerWithSpecificType.xml index be6a8b0d3..1026741d1 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandlerWithSpecificType.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandlerWithSpecificType.xml @@ -11,9 +11,11 @@ [Windows.Foundation.Metadata.Guid(603281085, 10445, 12788, 160, 94, 209, 35, 22, 179, 109, 110)] + [Windows.Foundation.Metadata.Guid(603281085, 10445, 12788, 160, 94, 209, 35, 22, 179, 109, 110)] [Windows.Foundation.Metadata.Version(1)] + [Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/SomethingHappenedEventHandler.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/SomethingHappenedEventHandler.xml index 17704f586..a45a8b2f3 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/SomethingHappenedEventHandler.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/SomethingHappenedEventHandler.xml @@ -11,9 +11,11 @@ [Windows.Foundation.Metadata.Guid(2298425249, 32140, 14992, 141, 140, 226, 207, 230, 43, 42, 170)] + [Windows.Foundation.Metadata.Guid(2298425249, 32140, 14992, 141, 140, 226, 207, 230, 43, 42, 170)] [Windows.Foundation.Metadata.Version(1)] + [Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/test-multiple-mdoc/Widget.xml b/mdoc/Test/test-multiple-mdoc/Widget.xml index 743ffdb70..f6e69fc0c 100644 --- a/mdoc/Test/test-multiple-mdoc/Widget.xml +++ b/mdoc/Test/test-multiple-mdoc/Widget.xml @@ -495,6 +495,7 @@ [Mono.DocTest.Doc("normal DocAttribute", Field=true)] + [Mono.DocTest.Doc("normal DocAttribute", Field=true)] @@ -502,6 +503,7 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] + [Mono.DocTest.Doc("return:DocAttribute", Property=Mono.DocTest.Widget)] @@ -510,6 +512,7 @@ [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] + [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] @@ -517,6 +520,7 @@ [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] + [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] @@ -524,6 +528,7 @@ [Mono.DocTest.Doc("v")] + [Mono.DocTest.Doc("v")] diff --git a/mdoc/Test/test-multiple-mdoc/en.expected.test.multiple.mdoc/Mono.DocTest/Widget.xml b/mdoc/Test/test-multiple-mdoc/en.expected.test.multiple.mdoc/Mono.DocTest/Widget.xml index 743ffdb70..f6e69fc0c 100644 --- a/mdoc/Test/test-multiple-mdoc/en.expected.test.multiple.mdoc/Mono.DocTest/Widget.xml +++ b/mdoc/Test/test-multiple-mdoc/en.expected.test.multiple.mdoc/Mono.DocTest/Widget.xml @@ -495,6 +495,7 @@ [Mono.DocTest.Doc("normal DocAttribute", Field=true)] + [Mono.DocTest.Doc("normal DocAttribute", Field=true)] @@ -502,6 +503,7 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] + [Mono.DocTest.Doc("return:DocAttribute", Property=Mono.DocTest.Widget)] @@ -510,6 +512,7 @@ [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] + [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] @@ -517,6 +520,7 @@ [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] + [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] @@ -524,6 +528,7 @@ [Mono.DocTest.Doc("v")] + [Mono.DocTest.Doc("v")] From c6d1c4569e2c5a5529aecbd5861598537894b98b Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Mon, 20 Jul 2020 17:42:54 +0800 Subject: [PATCH 03/18] Updated tests. --- .../AttributeFormatters/CppWinRtAttributeFormatter.cs | 2 +- mdoc/Test/ClassEnumeratorECMA.xml | 2 +- mdoc/Test/TestEcmaDocs.xml | 8 ++++---- .../Mono.DocTest.Generic/Func`2.xml | 10 +++++----- .../Test/ex.expected-cppwinrtuwp/Namespace2/Class2.xml | 10 +++++----- .../Test/ex.expected-cppwinrtuwp/Namespace2/Class3.xml | 8 ++++---- .../Test/ex.expected-cppwinrtuwp/Namespace2/Class4.xml | 2 +- mdoc/Test/ex.expected-cppwinrtuwp/Namespace222/App.xml | 10 +++++----- .../UwpTestWinRtComponentCpp/Class1.xml | 10 +++++----- .../UwpTestWinRtComponentCpp/Color1.xml | 2 +- .../UwpTestWinRtComponentCpp/CustomAttribute1.xml | 4 ++-- .../UwpTestWinRtComponentCpp/PrimeFoundHandler.xml | 4 ++-- .../PrimeFoundHandlerWithSpecificType.xml | 4 ++-- .../SomethingHappenedEventHandler.xml | 4 ++-- mdoc/Test/test-multiple-mdoc/Widget.xml | 10 +++++----- .../Mono.DocTest/Widget.xml | 10 +++++----- 16 files changed, 50 insertions(+), 50 deletions(-) diff --git a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs index 10e481c9f..90a1ee15d 100644 --- a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs +++ b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs @@ -8,7 +8,7 @@ namespace Mono.Documentation.Updater.Formatters { class CppWinRtAttributeFormatter : AttributeFormatter { - public override string PrefixBrackets { get; } = "["; + public override string PrefixBrackets { get; } = "///["; public override string SurfixBrackets { get; } = "]"; public override string Language => Consts.CppWinRt; } diff --git a/mdoc/Test/ClassEnumeratorECMA.xml b/mdoc/Test/ClassEnumeratorECMA.xml index 8fe135fd5..c129e2e72 100644 --- a/mdoc/Test/ClassEnumeratorECMA.xml +++ b/mdoc/Test/ClassEnumeratorECMA.xml @@ -106,7 +106,7 @@ [System.STAThread] [<System.STAThread>] - [System.STAThread] + ///[System.STAThread] diff --git a/mdoc/Test/TestEcmaDocs.xml b/mdoc/Test/TestEcmaDocs.xml index be44622fa..5f161c6c9 100644 --- a/mdoc/Test/TestEcmaDocs.xml +++ b/mdoc/Test/TestEcmaDocs.xml @@ -19,7 +19,7 @@ [CLSCompliantAttribute(true)] [<CLSCompliantAttribute(true)>] - [CLSCompliantAttribute(true)] + ///[CLSCompliantAttribute(true)] 0 @@ -62,7 +62,7 @@ [CLSCompliantAttribute(true)] [<CLSCompliantAttribute(true)>] - [CLSCompliantAttribute(true)] + ///[CLSCompliantAttribute(true)] 0 @@ -98,7 +98,7 @@ [CLSCompliantAttribute(true)] [<CLSCompliantAttribute(true)>] - [CLSCompliantAttribute(true)] + ///[CLSCompliantAttribute(true)] 0 @@ -197,7 +197,7 @@ [CLSCompliantAttribute(true)] [<CLSCompliantAttribute(true)>] - [CLSCompliantAttribute(true)] + ///[CLSCompliantAttribute(true)] 0 diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/Func`2.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/Func`2.xml index 59476c867..794c1683c 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/Func`2.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/Func`2.xml @@ -10,7 +10,7 @@ [Mono.DocTest.Doc("arg!")] - [Mono.DocTest.Doc("arg!")] + ///[Mono.DocTest.Doc("arg!")] @@ -22,7 +22,7 @@ [Mono.DocTest.Doc("ret!")] - [Mono.DocTest.Doc("ret!")] + ///[Mono.DocTest.Doc("ret!")] @@ -36,7 +36,7 @@ [Mono.DocTest.Doc("method")] - [Mono.DocTest.Doc("method")] + ///[Mono.DocTest.Doc("method")] @@ -44,7 +44,7 @@ [Mono.DocTest.Doc("arg-actual")] - [Mono.DocTest.Doc("arg-actual")] + ///[Mono.DocTest.Doc("arg-actual")] @@ -54,7 +54,7 @@ [Mono.DocTest.Doc("return", Field=false)] - [Mono.DocTest.Doc("return", Field=false)] + ///[Mono.DocTest.Doc("return", Field=false)] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class2.xml b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class2.xml index 46af32a2e..667372742 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class2.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class2.xml @@ -13,23 +13,23 @@ [Windows.Foundation.Metadata.Composable(typeof(Namespace2.__IClass2ProtectedFactory), Windows.Foundation.Metadata.CompositionType.Protected, 1)] - [Windows.Foundation.Metadata.Composable(Namespace2.__IClass2ProtectedFactory, Windows.Foundation.Metadata.CompositionType.Protected, 1)] + ///[Windows.Foundation.Metadata.Composable(Namespace2.__IClass2ProtectedFactory, Windows.Foundation.Metadata.CompositionType.Protected, 1)] [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] - [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] + ///[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] - [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] + ///[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] [Windows.Foundation.Metadata.Version(1)] - [Windows.Foundation.Metadata.Version(1)] + ///[Windows.Foundation.Metadata.Version(1)] [Windows.Foundation.Metadata.WebHostHidden] - [Windows.Foundation.Metadata.WebHostHidden] + ///[Windows.Foundation.Metadata.WebHostHidden] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class3.xml b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class3.xml index eaa9b3a81..27a661634 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class3.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class3.xml @@ -13,19 +13,19 @@ [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] - [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] + ///[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] - [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] + ///[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] [Windows.Foundation.Metadata.Version(1)] - [Windows.Foundation.Metadata.Version(1)] + ///[Windows.Foundation.Metadata.Version(1)] [Windows.Foundation.Metadata.WebHostHidden] - [Windows.Foundation.Metadata.WebHostHidden] + ///[Windows.Foundation.Metadata.WebHostHidden] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class4.xml b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class4.xml index 862bf887a..aa735b688 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class4.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class4.xml @@ -13,7 +13,7 @@ [Windows.Foundation.Metadata.Version(1)] - [Windows.Foundation.Metadata.Version(1)] + ///[Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace222/App.xml b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace222/App.xml index 8ae46ee47..8f970e571 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace222/App.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace222/App.xml @@ -17,19 +17,19 @@ [Windows.Foundation.Metadata.Activatable(1)] - [Windows.Foundation.Metadata.Activatable(1)] + ///[Windows.Foundation.Metadata.Activatable(1)] [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] - [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] + ///[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] - [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] + ///[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] [Windows.Foundation.Metadata.Version(1)] - [Windows.Foundation.Metadata.Version(1)] + ///[Windows.Foundation.Metadata.Version(1)] @@ -48,7 +48,7 @@ [Windows.Foundation.Metadata.Overload("CreateInstance1")] - [Windows.Foundation.Metadata.Overload("CreateInstance1")] + ///[Windows.Foundation.Metadata.Overload("CreateInstance1")] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Class1.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Class1.xml index 21e89e565..6d3bc6aca 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Class1.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Class1.xml @@ -13,19 +13,19 @@ [Windows.Foundation.Metadata.Activatable(1)] - [Windows.Foundation.Metadata.Activatable(1)] + ///[Windows.Foundation.Metadata.Activatable(1)] [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] - [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] + ///[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] - [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] + ///[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] [Windows.Foundation.Metadata.Version(1)] - [Windows.Foundation.Metadata.Version(1)] + ///[Windows.Foundation.Metadata.Version(1)] @@ -44,7 +44,7 @@ [Windows.Foundation.Metadata.Overload("CreateInstance1")] - [Windows.Foundation.Metadata.Overload("CreateInstance1")] + ///[Windows.Foundation.Metadata.Overload("CreateInstance1")] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Color1.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Color1.xml index b72391ba3..9391c51bc 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Color1.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Color1.xml @@ -12,7 +12,7 @@ [Windows.Foundation.Metadata.Version(1)] - [Windows.Foundation.Metadata.Version(1)] + ///[Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/CustomAttribute1.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/CustomAttribute1.xml index efd5a278b..e11dccb08 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/CustomAttribute1.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/CustomAttribute1.xml @@ -12,7 +12,7 @@ [Windows.Foundation.Metadata.Version(1)] - [Windows.Foundation.Metadata.Version(1)] + ///[Windows.Foundation.Metadata.Version(1)] @@ -31,7 +31,7 @@ [Windows.Foundation.Metadata.Overload("CreateInstance1")] - [Windows.Foundation.Metadata.Overload("CreateInstance1")] + ///[Windows.Foundation.Metadata.Overload("CreateInstance1")] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandler.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandler.xml index 5fca9c150..0c31f60a3 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandler.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandler.xml @@ -11,11 +11,11 @@ [Windows.Foundation.Metadata.Guid(1538629431, 28309, 13279, 150, 105, 205, 62, 250, 110, 149, 1)] - [Windows.Foundation.Metadata.Guid(1538629431, 28309, 13279, 150, 105, 205, 62, 250, 110, 149, 1)] + ///[Windows.Foundation.Metadata.Guid(1538629431, 28309, 13279, 150, 105, 205, 62, 250, 110, 149, 1)] [Windows.Foundation.Metadata.Version(1)] - [Windows.Foundation.Metadata.Version(1)] + ///[Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandlerWithSpecificType.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandlerWithSpecificType.xml index 1026741d1..e473774d2 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandlerWithSpecificType.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandlerWithSpecificType.xml @@ -11,11 +11,11 @@ [Windows.Foundation.Metadata.Guid(603281085, 10445, 12788, 160, 94, 209, 35, 22, 179, 109, 110)] - [Windows.Foundation.Metadata.Guid(603281085, 10445, 12788, 160, 94, 209, 35, 22, 179, 109, 110)] + ///[Windows.Foundation.Metadata.Guid(603281085, 10445, 12788, 160, 94, 209, 35, 22, 179, 109, 110)] [Windows.Foundation.Metadata.Version(1)] - [Windows.Foundation.Metadata.Version(1)] + ///[Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/SomethingHappenedEventHandler.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/SomethingHappenedEventHandler.xml index a45a8b2f3..3c7330f6f 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/SomethingHappenedEventHandler.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/SomethingHappenedEventHandler.xml @@ -11,11 +11,11 @@ [Windows.Foundation.Metadata.Guid(2298425249, 32140, 14992, 141, 140, 226, 207, 230, 43, 42, 170)] - [Windows.Foundation.Metadata.Guid(2298425249, 32140, 14992, 141, 140, 226, 207, 230, 43, 42, 170)] + ///[Windows.Foundation.Metadata.Guid(2298425249, 32140, 14992, 141, 140, 226, 207, 230, 43, 42, 170)] [Windows.Foundation.Metadata.Version(1)] - [Windows.Foundation.Metadata.Version(1)] + ///[Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/test-multiple-mdoc/Widget.xml b/mdoc/Test/test-multiple-mdoc/Widget.xml index f6e69fc0c..f0356cec9 100644 --- a/mdoc/Test/test-multiple-mdoc/Widget.xml +++ b/mdoc/Test/test-multiple-mdoc/Widget.xml @@ -495,7 +495,7 @@ [Mono.DocTest.Doc("normal DocAttribute", Field=true)] - [Mono.DocTest.Doc("normal DocAttribute", Field=true)] + ///[Mono.DocTest.Doc("normal DocAttribute", Field=true)] @@ -503,7 +503,7 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] - [Mono.DocTest.Doc("return:DocAttribute", Property=Mono.DocTest.Widget)] + ///[Mono.DocTest.Doc("return:DocAttribute", Property=Mono.DocTest.Widget)] @@ -512,7 +512,7 @@ [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] - [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] + ///[Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] @@ -520,7 +520,7 @@ [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] - [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] + ///[Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] @@ -528,7 +528,7 @@ [Mono.DocTest.Doc("v")] - [Mono.DocTest.Doc("v")] + ///[Mono.DocTest.Doc("v")] diff --git a/mdoc/Test/test-multiple-mdoc/en.expected.test.multiple.mdoc/Mono.DocTest/Widget.xml b/mdoc/Test/test-multiple-mdoc/en.expected.test.multiple.mdoc/Mono.DocTest/Widget.xml index f6e69fc0c..f0356cec9 100644 --- a/mdoc/Test/test-multiple-mdoc/en.expected.test.multiple.mdoc/Mono.DocTest/Widget.xml +++ b/mdoc/Test/test-multiple-mdoc/en.expected.test.multiple.mdoc/Mono.DocTest/Widget.xml @@ -495,7 +495,7 @@ [Mono.DocTest.Doc("normal DocAttribute", Field=true)] - [Mono.DocTest.Doc("normal DocAttribute", Field=true)] + ///[Mono.DocTest.Doc("normal DocAttribute", Field=true)] @@ -503,7 +503,7 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] - [Mono.DocTest.Doc("return:DocAttribute", Property=Mono.DocTest.Widget)] + ///[Mono.DocTest.Doc("return:DocAttribute", Property=Mono.DocTest.Widget)] @@ -512,7 +512,7 @@ [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] - [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] + ///[Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] @@ -520,7 +520,7 @@ [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] - [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] + ///[Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] @@ -528,7 +528,7 @@ [Mono.DocTest.Doc("v")] - [Mono.DocTest.Doc("v")] + ///[Mono.DocTest.Doc("v")] From 880f3cd675737cf412245151f4fb85c50009e597 Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Tue, 21 Jul 2020 17:04:43 +0800 Subject: [PATCH 04/18] Updated AttributeFormatter to support CppWinRt. --- .../AttributeFormatters/AttributeFormatter.cs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs index e7c6d45fd..dbc0c324c 100644 --- a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs +++ b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs @@ -90,9 +90,10 @@ public virtual bool TryGetAttributeString(CustomAttribute attribute, out string for (int i = 0; i < attribute.ConstructorArguments.Count; ++i) { CustomAttributeArgument argument = attribute.ConstructorArguments[i]; - fields.Add(MakeAttributesValueString( - argument.Value, - argument.Type)); + string attributesValue = MakeAttributesValueString(argument.Value, argument.Type); + if (Language == Consts.CppWinRt && attributesValue.StartsWith("typeof(")) + attributesValue = attributesValue.Substring(7, attributesValue.Length - 8); + fields.Add(attributesValue); } var namedArgs = (from namedArg in attribute.Fields @@ -101,8 +102,12 @@ public virtual bool TryGetAttributeString(CustomAttribute attribute, out string (from namedArg in attribute.Properties select new { Type = namedArg.Argument.Type, Name = namedArg.Name, Value = namedArg.Argument.Value })) .OrderBy(v => v.Name); - foreach (var d in namedArgs) - fields.Add(MakeNamedArgumentString(d.Name, MakeAttributesValueString(d.Value, d.Type))); + foreach (var d in namedArgs) { + string namedArgument = MakeNamedArgumentString(d.Name, MakeAttributesValueString(d.Value, d.Type)); + if (Language == Consts.CppWinRt && namedArgument.StartsWith("typeof(")) + namedArgument = namedArgument.Substring(7, namedArgument.Length - 8); + fields.Add(namedArgument); + } string a2 = String.Join(", ", fields.ToArray()); if (a2 != "") a2 = "(" + a2 + ")"; From f9bf523f072d5730d3272d80b0b160a87bc50eac Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Tue, 21 Jul 2020 17:32:36 +0800 Subject: [PATCH 05/18] Updated test. --- .../CustomNamespace/ClassEnumerator.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mdoc/Test/en.expected-eii-implementation-slashdoc/CustomNamespace/ClassEnumerator.xml b/mdoc/Test/en.expected-eii-implementation-slashdoc/CustomNamespace/ClassEnumerator.xml index 8e4c5a50f..2119a48c4 100644 --- a/mdoc/Test/en.expected-eii-implementation-slashdoc/CustomNamespace/ClassEnumerator.xml +++ b/mdoc/Test/en.expected-eii-implementation-slashdoc/CustomNamespace/ClassEnumerator.xml @@ -105,7 +105,7 @@ [System.STAThread] [<System.STAThread>] - [System.STAThread] + ///[System.STAThread] From 840d1e7a0ce0809401ea372b49b7856cb2b5760d Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Tue, 21 Jul 2020 17:43:05 +0800 Subject: [PATCH 06/18] Updated ClassEnumerator tests. --- .../CustomNamespace/ClassEnumerator.xml | 2 +- .../CustomNamespace/ClassEnumerator.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mdoc/Test/en.expected-eii-implementation-ecmadoc/CustomNamespace/ClassEnumerator.xml b/mdoc/Test/en.expected-eii-implementation-ecmadoc/CustomNamespace/ClassEnumerator.xml index 6492c683f..0a067453b 100644 --- a/mdoc/Test/en.expected-eii-implementation-ecmadoc/CustomNamespace/ClassEnumerator.xml +++ b/mdoc/Test/en.expected-eii-implementation-ecmadoc/CustomNamespace/ClassEnumerator.xml @@ -101,7 +101,7 @@ [System.STAThread] [<System.STAThread>] - [System.STAThread] + ///[System.STAThread] diff --git a/mdoc/Test/en.expected-eii-implementation/CustomNamespace/ClassEnumerator.xml b/mdoc/Test/en.expected-eii-implementation/CustomNamespace/ClassEnumerator.xml index f7ed1410b..70e82e050 100644 --- a/mdoc/Test/en.expected-eii-implementation/CustomNamespace/ClassEnumerator.xml +++ b/mdoc/Test/en.expected-eii-implementation/CustomNamespace/ClassEnumerator.xml @@ -101,7 +101,7 @@ [System.STAThread] [<System.STAThread>] - [System.STAThread] + ///[System.STAThread] From 376d967e4e9e05262c04e3e4befae8801974180b Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Tue, 21 Jul 2020 17:57:04 +0800 Subject: [PATCH 07/18] Updated tests. --- .../en.expected/Mono.DocTest.Generic/Func`2.xml | 10 +++++----- .../Mono.DocTest.Generic/GenericBase`1.xml | 2 +- .../Mono.DocTest.Generic/MyList`1.xml | 2 +- .../en.expected/Mono.DocTest/DocAttribute.xml | 1 + .../Mono.DocTest/Widget+Direction.xml | 1 + mdoc/Test/en.expected/Mono.DocTest/Widget.xml | 16 ++++++++++++++++ 6 files changed, 25 insertions(+), 7 deletions(-) diff --git a/mdoc/Test/en.expected/Mono.DocTest.Generic/Func`2.xml b/mdoc/Test/en.expected/Mono.DocTest.Generic/Func`2.xml index 809dcbc41..e936db516 100644 --- a/mdoc/Test/en.expected/Mono.DocTest.Generic/Func`2.xml +++ b/mdoc/Test/en.expected/Mono.DocTest.Generic/Func`2.xml @@ -15,7 +15,7 @@ [Mono.DocTest.Doc("arg!")] [<Mono.DocTest.Doc("arg!")>] - [Mono.DocTest.Doc("arg!")] + ///[Mono.DocTest.Doc("arg!")] @@ -28,7 +28,7 @@ [Mono.DocTest.Doc("ret!")] [<Mono.DocTest.Doc("ret!")>] - [Mono.DocTest.Doc("ret!")] + ///[Mono.DocTest.Doc("ret!")] @@ -43,7 +43,7 @@ [Mono.DocTest.Doc("method")] [<Mono.DocTest.Doc("method")>] - [Mono.DocTest.Doc("method")] + ///[Mono.DocTest.Doc("method")] @@ -52,7 +52,7 @@ [Mono.DocTest.Doc("arg-actual")] [<Mono.DocTest.Doc("arg-actual")>] - [Mono.DocTest.Doc("arg-actual")] + ///[Mono.DocTest.Doc("arg-actual")] @@ -63,7 +63,7 @@ [Mono.DocTest.Doc("return", Field=false)] [<Mono.DocTest.Doc("return", Field=false)>] - [Mono.DocTest.Doc("return", Field=false)] + ///[Mono.DocTest.Doc("return", Field=false)] diff --git a/mdoc/Test/en.expected/Mono.DocTest.Generic/GenericBase`1.xml b/mdoc/Test/en.expected/Mono.DocTest.Generic/GenericBase`1.xml index f50480de8..c4474afb3 100644 --- a/mdoc/Test/en.expected/Mono.DocTest.Generic/GenericBase`1.xml +++ b/mdoc/Test/en.expected/Mono.DocTest.Generic/GenericBase`1.xml @@ -63,7 +63,7 @@ [Mono.DocTest.Doc("S")] [<Mono.DocTest.Doc("S")>] - [Mono.DocTest.Doc("S")] + ///[Mono.DocTest.Doc("S")] diff --git a/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml b/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml index a47bc7cb9..9b9d5844c 100644 --- a/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml +++ b/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml @@ -15,7 +15,7 @@ [Mono.DocTest.Doc("Type Parameter!")] [<Mono.DocTest.Doc("Type Parameter!")>] - [Mono.DocTest.Doc("Type Parameter!")] + ///[Mono.DocTest.Doc("Type Parameter!")] diff --git a/mdoc/Test/en.expected/Mono.DocTest/DocAttribute.xml b/mdoc/Test/en.expected/Mono.DocTest/DocAttribute.xml index b8602ee9f..d3cc3ceae 100644 --- a/mdoc/Test/en.expected/Mono.DocTest/DocAttribute.xml +++ b/mdoc/Test/en.expected/Mono.DocTest/DocAttribute.xml @@ -18,6 +18,7 @@ [System.AttributeUsage(System.AttributeTargets.All)] [<System.AttributeUsage(System.AttributeTargets.All)>] + ///[System.AttributeUsage(System.AttributeTargets.All)] diff --git a/mdoc/Test/en.expected/Mono.DocTest/Widget+Direction.xml b/mdoc/Test/en.expected/Mono.DocTest/Widget+Direction.xml index e91ce45a5..b51ae29c0 100644 --- a/mdoc/Test/en.expected/Mono.DocTest/Widget+Direction.xml +++ b/mdoc/Test/en.expected/Mono.DocTest/Widget+Direction.xml @@ -17,6 +17,7 @@ [System.Flags] [<System.Flags>] + ///[System.Flags] diff --git a/mdoc/Test/en.expected/Mono.DocTest/Widget.xml b/mdoc/Test/en.expected/Mono.DocTest/Widget.xml index ff9f271e9..2bc6f50dc 100644 --- a/mdoc/Test/en.expected/Mono.DocTest/Widget.xml +++ b/mdoc/Test/en.expected/Mono.DocTest/Widget.xml @@ -104,14 +104,17 @@ [Mono.DocTest.Doc("Del event")] [<Mono.DocTest.Doc("Del event")>] + ///[Mono.DocTest.Doc("Del event")] [add: Mono.DocTest.Doc("Del add accessor")] [<add: Mono.DocTest.Doc("Del add accessor")>] + ///[add: Mono.DocTest.Doc("Del add accessor")] [remove: Mono.DocTest.Doc("Del remove accessor")] [<remove: Mono.DocTest.Doc("Del remove accessor")>] + ///[remove: Mono.DocTest.Doc("Del remove accessor")] @@ -397,6 +400,7 @@ [System.Obsolete("why not")] [<System.Obsolete("why not")>] + ///[System.Obsolete("why not")] @@ -486,6 +490,7 @@ [Mono.DocTest.Doc("Height property")] [<Mono.DocTest.Doc("Height property")>] + ///[Mono.DocTest.Doc("Height property")] @@ -513,10 +518,12 @@ [Mono.DocTest.Doc("Item property")] [<Mono.DocTest.Doc("Item property")>] + ///[Mono.DocTest.Doc("Item property")] [set: Mono.DocTest.Doc("Item property set accessor")] [<set: Mono.DocTest.Doc("Item property set accessor")>] + ///[set: Mono.DocTest.Doc("Item property set accessor")] @@ -598,6 +605,7 @@ [Mono.DocTest.Doc("normal DocAttribute", Field=true)] [<Mono.DocTest.Doc("normal DocAttribute", Field=true)>] + ///[Mono.DocTest.Doc("normal DocAttribute", Field=true)] @@ -606,6 +614,7 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] [<Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))>] + ///[Mono.DocTest.Doc("return:DocAttribute", Property=Mono.DocTest.Widget)] @@ -615,6 +624,7 @@ [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] [<Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)>] + [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] @@ -623,6 +633,7 @@ [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] [<Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)>] + [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] @@ -631,6 +642,7 @@ [Mono.DocTest.Doc("v")] [<Mono.DocTest.Doc("v")>] + [Mono.DocTest.Doc("v")] @@ -773,6 +785,7 @@ [System.ParamArray] [<System.ParamArray>] + ///[System.ParamArray] @@ -1050,14 +1063,17 @@ [Mono.DocTest.Doc("Width property")] [<Mono.DocTest.Doc("Width property")>] + ///[Mono.DocTest.Doc("Width property")] [get: Mono.DocTest.Doc("Width get accessor")] [<get: Mono.DocTest.Doc("Width get accessor")>] + ///[get: Mono.DocTest.Doc("Width get accessor")] [set: Mono.DocTest.Doc("Width set accessor")] [<set: Mono.DocTest.Doc("Width set accessor")>] + ///[set: Mono.DocTest.Doc("Width set accessor")] From e622f4bd85fc988d9d64ea25bc7c079da66ad3ae Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Tue, 21 Jul 2020 18:00:29 +0800 Subject: [PATCH 08/18] Updated Widget --- mdoc/Test/en.expected/Mono.DocTest/Widget.xml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mdoc/Test/en.expected/Mono.DocTest/Widget.xml b/mdoc/Test/en.expected/Mono.DocTest/Widget.xml index 2bc6f50dc..aaa466623 100644 --- a/mdoc/Test/en.expected/Mono.DocTest/Widget.xml +++ b/mdoc/Test/en.expected/Mono.DocTest/Widget.xml @@ -614,7 +614,7 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] [<Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))>] - ///[Mono.DocTest.Doc("return:DocAttribute", Property=Mono.DocTest.Widget)] + ///[Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] @@ -624,7 +624,7 @@ [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] [<Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)>] - [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] + ///[Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] @@ -633,7 +633,7 @@ [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] [<Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)>] - [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] + ///[Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] @@ -642,7 +642,7 @@ [Mono.DocTest.Doc("v")] [<Mono.DocTest.Doc("v")>] - [Mono.DocTest.Doc("v")] + ///[Mono.DocTest.Doc("v")] From 49caa69239e1df568d146efe0264c0dde631944a Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Tue, 21 Jul 2020 18:05:45 +0800 Subject: [PATCH 09/18] Updated cppwinrt2 tests --- .../Mono.DocTest.Generic/GenericBase`1.xml | 2 +- .../Mono.DocTest.Generic/MyList`1.xml | 2 +- .../Mono.DocTest/DocAttribute.xml | 2 +- .../Mono.DocTest/Widget+Direction.xml | 2 +- .../Mono.DocTest/Widget.xml | 32 +++++++++---------- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/GenericBase`1.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/GenericBase`1.xml index b2df26c89..f4304b05a 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/GenericBase`1.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/GenericBase`1.xml @@ -49,7 +49,7 @@ [Mono.DocTest.Doc("S")] - [Mono.DocTest.Doc("S")] + ///[Mono.DocTest.Doc("S")] diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/MyList`1.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/MyList`1.xml index 7b468f5a0..b7518edec 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/MyList`1.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/MyList`1.xml @@ -10,7 +10,7 @@ [Mono.DocTest.Doc("Type Parameter!")] - [Mono.DocTest.Doc("Type Parameter!")] + ///[Mono.DocTest.Doc("Type Parameter!")] diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/DocAttribute.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/DocAttribute.xml index b9b3e36e8..3152d17a3 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/DocAttribute.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/DocAttribute.xml @@ -12,7 +12,7 @@ [System.AttributeUsage(System.AttributeTargets.All)] - [System.AttributeUsage(System.AttributeTargets.All)] + ///[System.AttributeUsage(System.AttributeTargets.All)] diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget+Direction.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget+Direction.xml index 107f4a0ba..ee9625791 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget+Direction.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget+Direction.xml @@ -12,7 +12,7 @@ [System.Flags] - [System.Flags] + ///[System.Flags] diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml index 37e6b1f3f..e650a8229 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml @@ -77,15 +77,15 @@ [Mono.DocTest.Doc("Del event")] - [Mono.DocTest.Doc("Del event")] + [Mono.DocTest.Doc("Del event")] [add: Mono.DocTest.Doc("Del add accessor")] - [add: Mono.DocTest.Doc("Del add accessor")] + ///[add: Mono.DocTest.Doc("Del add accessor")] [remove: Mono.DocTest.Doc("Del remove accessor")] - [remove: Mono.DocTest.Doc("Del remove accessor")] + ///[remove: Mono.DocTest.Doc("Del remove accessor")] @@ -314,7 +314,7 @@ [System.Obsolete("why not")] - [System.Obsolete("why not")] + ///[System.Obsolete("why not")] @@ -384,7 +384,7 @@ [Mono.DocTest.Doc("Height property")] - [Mono.DocTest.Doc("Height property")] + ///[Mono.DocTest.Doc("Height property")] @@ -407,11 +407,11 @@ [Mono.DocTest.Doc("Item property")] - [Mono.DocTest.Doc("Item property")] + ///[Mono.DocTest.Doc("Item property")] [set: Mono.DocTest.Doc("Item property set accessor")] - [set: Mono.DocTest.Doc("Item property set accessor")] + ///[set: Mono.DocTest.Doc("Item property set accessor")] @@ -478,7 +478,7 @@ [Mono.DocTest.Doc("normal DocAttribute", Field=true)] - [Mono.DocTest.Doc("normal DocAttribute", Field=true)] + ///[Mono.DocTest.Doc("normal DocAttribute", Field=true)] @@ -486,7 +486,7 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] - [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] + ///[Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] @@ -495,7 +495,7 @@ [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] - [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] + ///[Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] @@ -503,7 +503,7 @@ [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] - [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] + ///[Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] @@ -511,7 +511,7 @@ [Mono.DocTest.Doc("v")] - [Mono.DocTest.Doc("v")] + ///[Mono.DocTest.Doc("v")] @@ -630,7 +630,7 @@ [System.ParamArray] - [System.ParamArray] + ///[System.ParamArray] @@ -856,15 +856,15 @@ [Mono.DocTest.Doc("Width property")] - [Mono.DocTest.Doc("Width property")] + ///[Mono.DocTest.Doc("Width property")] [get: Mono.DocTest.Doc("Width get accessor")] - [get: Mono.DocTest.Doc("Width get accessor")] + ///[get: Mono.DocTest.Doc("Width get accessor")] [set: Mono.DocTest.Doc("Width set accessor")] - [set: Mono.DocTest.Doc("Width set accessor")] + ///[set: Mono.DocTest.Doc("Width set accessor")] From 116f9a844f7f97ad4bc769c6f2095a05d10f288f Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Tue, 21 Jul 2020 18:08:23 +0800 Subject: [PATCH 10/18] Fixed Widget. --- mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml index e650a8229..6f5b79b01 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml @@ -77,7 +77,7 @@ [Mono.DocTest.Doc("Del event")] - [Mono.DocTest.Doc("Del event")] + ///[Mono.DocTest.Doc("Del event")] [add: Mono.DocTest.Doc("Del add accessor")] From 203e0307784add890f645fde7f502e17c707a6d9 Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Wed, 22 Jul 2020 09:39:02 +0800 Subject: [PATCH 11/18] Updated Widget, delete C++ WINRT attribute name --- mdoc/Test/test-multiple-mdoc/Widget.xml | 5 ----- .../en.expected.test.multiple.mdoc/Mono.DocTest/Widget.xml | 5 ----- 2 files changed, 10 deletions(-) diff --git a/mdoc/Test/test-multiple-mdoc/Widget.xml b/mdoc/Test/test-multiple-mdoc/Widget.xml index f0356cec9..743ffdb70 100644 --- a/mdoc/Test/test-multiple-mdoc/Widget.xml +++ b/mdoc/Test/test-multiple-mdoc/Widget.xml @@ -495,7 +495,6 @@ [Mono.DocTest.Doc("normal DocAttribute", Field=true)] - ///[Mono.DocTest.Doc("normal DocAttribute", Field=true)] @@ -503,7 +502,6 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] - ///[Mono.DocTest.Doc("return:DocAttribute", Property=Mono.DocTest.Widget)] @@ -512,7 +510,6 @@ [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] - ///[Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] @@ -520,7 +517,6 @@ [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] - ///[Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] @@ -528,7 +524,6 @@ [Mono.DocTest.Doc("v")] - ///[Mono.DocTest.Doc("v")] diff --git a/mdoc/Test/test-multiple-mdoc/en.expected.test.multiple.mdoc/Mono.DocTest/Widget.xml b/mdoc/Test/test-multiple-mdoc/en.expected.test.multiple.mdoc/Mono.DocTest/Widget.xml index f0356cec9..743ffdb70 100644 --- a/mdoc/Test/test-multiple-mdoc/en.expected.test.multiple.mdoc/Mono.DocTest/Widget.xml +++ b/mdoc/Test/test-multiple-mdoc/en.expected.test.multiple.mdoc/Mono.DocTest/Widget.xml @@ -495,7 +495,6 @@ [Mono.DocTest.Doc("normal DocAttribute", Field=true)] - ///[Mono.DocTest.Doc("normal DocAttribute", Field=true)] @@ -503,7 +502,6 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] - ///[Mono.DocTest.Doc("return:DocAttribute", Property=Mono.DocTest.Widget)] @@ -512,7 +510,6 @@ [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] - ///[Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] @@ -520,7 +517,6 @@ [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] - ///[Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] @@ -528,7 +524,6 @@ [Mono.DocTest.Doc("v")] - ///[Mono.DocTest.Doc("v")] From e5e9d32f464cd2e8c3ac91fb5090b869e2730e0b Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Fri, 24 Jul 2020 11:33:31 +0800 Subject: [PATCH 12/18] =?UTF-8?q?Updated=20tests.=20Added=20a=20space=20be?= =?UTF-8?q?tween=20'///'=20and=20=E2=80=98['?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- mdoc/Test/ClassEnumeratorECMA.xml | 2 +- mdoc/Test/TestEcmaDocs.xml | 8 ++--- .../Mono.DocTest/Widget.xml | 32 +++++++++---------- .../Namespace2/Class2.xml | 10 +++--- .../Namespace2/Class3.xml | 8 ++--- .../Namespace2/Class4.xml | 2 +- .../Namespace222/App.xml | 10 +++--- .../UwpTestWinRtComponentCpp/Class1.xml | 10 +++--- .../UwpTestWinRtComponentCpp/Color1.xml | 2 +- .../CustomAttribute1.xml | 4 +-- .../PrimeFoundHandler.xml | 4 +-- .../PrimeFoundHandlerWithSpecificType.xml | 4 +-- .../SomethingHappenedEventHandler.xml | 4 +-- 13 files changed, 50 insertions(+), 50 deletions(-) diff --git a/mdoc/Test/ClassEnumeratorECMA.xml b/mdoc/Test/ClassEnumeratorECMA.xml index c129e2e72..054dc3538 100644 --- a/mdoc/Test/ClassEnumeratorECMA.xml +++ b/mdoc/Test/ClassEnumeratorECMA.xml @@ -106,7 +106,7 @@ [System.STAThread] [<System.STAThread>] - ///[System.STAThread] + /// [System.STAThread] diff --git a/mdoc/Test/TestEcmaDocs.xml b/mdoc/Test/TestEcmaDocs.xml index 5f161c6c9..a310c1ad4 100644 --- a/mdoc/Test/TestEcmaDocs.xml +++ b/mdoc/Test/TestEcmaDocs.xml @@ -19,7 +19,7 @@ [CLSCompliantAttribute(true)] [<CLSCompliantAttribute(true)>] - ///[CLSCompliantAttribute(true)] + /// [CLSCompliantAttribute(true)] 0 @@ -62,7 +62,7 @@ [CLSCompliantAttribute(true)] [<CLSCompliantAttribute(true)>] - ///[CLSCompliantAttribute(true)] + /// [CLSCompliantAttribute(true)] 0 @@ -98,7 +98,7 @@ [CLSCompliantAttribute(true)] [<CLSCompliantAttribute(true)>] - ///[CLSCompliantAttribute(true)] + /// [CLSCompliantAttribute(true)] 0 @@ -197,7 +197,7 @@ [CLSCompliantAttribute(true)] [<CLSCompliantAttribute(true)>] - ///[CLSCompliantAttribute(true)] + /// [CLSCompliantAttribute(true)] 0 diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml index 6f5b79b01..7446bfad6 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml @@ -77,15 +77,15 @@ [Mono.DocTest.Doc("Del event")] - ///[Mono.DocTest.Doc("Del event")] + /// [Mono.DocTest.Doc("Del event")] [add: Mono.DocTest.Doc("Del add accessor")] - ///[add: Mono.DocTest.Doc("Del add accessor")] + /// [add: Mono.DocTest.Doc("Del add accessor")] [remove: Mono.DocTest.Doc("Del remove accessor")] - ///[remove: Mono.DocTest.Doc("Del remove accessor")] + /// [remove: Mono.DocTest.Doc("Del remove accessor")] @@ -314,7 +314,7 @@ [System.Obsolete("why not")] - ///[System.Obsolete("why not")] + /// [System.Obsolete("why not")] @@ -384,7 +384,7 @@ [Mono.DocTest.Doc("Height property")] - ///[Mono.DocTest.Doc("Height property")] + /// [Mono.DocTest.Doc("Height property")] @@ -407,11 +407,11 @@ [Mono.DocTest.Doc("Item property")] - ///[Mono.DocTest.Doc("Item property")] + /// [Mono.DocTest.Doc("Item property")] [set: Mono.DocTest.Doc("Item property set accessor")] - ///[set: Mono.DocTest.Doc("Item property set accessor")] + /// [set: Mono.DocTest.Doc("Item property set accessor")] @@ -478,7 +478,7 @@ [Mono.DocTest.Doc("normal DocAttribute", Field=true)] - ///[Mono.DocTest.Doc("normal DocAttribute", Field=true)] + /// [Mono.DocTest.Doc("normal DocAttribute", Field=true)] @@ -486,7 +486,7 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] - ///[Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] + /// [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] @@ -495,7 +495,7 @@ [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] - ///[Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] + /// [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] @@ -503,7 +503,7 @@ [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] - ///[Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] + /// [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] @@ -511,7 +511,7 @@ [Mono.DocTest.Doc("v")] - ///[Mono.DocTest.Doc("v")] + /// [Mono.DocTest.Doc("v")] @@ -630,7 +630,7 @@ [System.ParamArray] - ///[System.ParamArray] + /// [System.ParamArray] @@ -856,15 +856,15 @@ [Mono.DocTest.Doc("Width property")] - ///[Mono.DocTest.Doc("Width property")] + /// [Mono.DocTest.Doc("Width property")] [get: Mono.DocTest.Doc("Width get accessor")] - ///[get: Mono.DocTest.Doc("Width get accessor")] + /// [get: Mono.DocTest.Doc("Width get accessor")] [set: Mono.DocTest.Doc("Width set accessor")] - ///[set: Mono.DocTest.Doc("Width set accessor")] + /// [set: Mono.DocTest.Doc("Width set accessor")] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class2.xml b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class2.xml index 667372742..b0b15b7db 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class2.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class2.xml @@ -13,23 +13,23 @@ [Windows.Foundation.Metadata.Composable(typeof(Namespace2.__IClass2ProtectedFactory), Windows.Foundation.Metadata.CompositionType.Protected, 1)] - ///[Windows.Foundation.Metadata.Composable(Namespace2.__IClass2ProtectedFactory, Windows.Foundation.Metadata.CompositionType.Protected, 1)] + /// [Windows.Foundation.Metadata.Composable(Namespace2.__IClass2ProtectedFactory, Windows.Foundation.Metadata.CompositionType.Protected, 1)] [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] - ///[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] + /// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] - ///[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] + /// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] [Windows.Foundation.Metadata.Version(1)] - ///[Windows.Foundation.Metadata.Version(1)] + /// [Windows.Foundation.Metadata.Version(1)] [Windows.Foundation.Metadata.WebHostHidden] - ///[Windows.Foundation.Metadata.WebHostHidden] + /// [Windows.Foundation.Metadata.WebHostHidden] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class3.xml b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class3.xml index 27a661634..17f0499ab 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class3.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class3.xml @@ -13,19 +13,19 @@ [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] - ///[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] + /// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] - ///[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] + /// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] [Windows.Foundation.Metadata.Version(1)] - ///[Windows.Foundation.Metadata.Version(1)] + /// [Windows.Foundation.Metadata.Version(1)] [Windows.Foundation.Metadata.WebHostHidden] - ///[Windows.Foundation.Metadata.WebHostHidden] + /// [Windows.Foundation.Metadata.WebHostHidden] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class4.xml b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class4.xml index aa735b688..51cd4edac 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class4.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace2/Class4.xml @@ -13,7 +13,7 @@ [Windows.Foundation.Metadata.Version(1)] - ///[Windows.Foundation.Metadata.Version(1)] + /// [Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace222/App.xml b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace222/App.xml index 8f970e571..f91c17d9b 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/Namespace222/App.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/Namespace222/App.xml @@ -17,19 +17,19 @@ [Windows.Foundation.Metadata.Activatable(1)] - ///[Windows.Foundation.Metadata.Activatable(1)] + /// [Windows.Foundation.Metadata.Activatable(1)] [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] - ///[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] + /// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] - ///[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] + /// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] [Windows.Foundation.Metadata.Version(1)] - ///[Windows.Foundation.Metadata.Version(1)] + /// [Windows.Foundation.Metadata.Version(1)] @@ -48,7 +48,7 @@ [Windows.Foundation.Metadata.Overload("CreateInstance1")] - ///[Windows.Foundation.Metadata.Overload("CreateInstance1")] + /// [Windows.Foundation.Metadata.Overload("CreateInstance1")] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Class1.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Class1.xml index 6d3bc6aca..7cfe9ca53 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Class1.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Class1.xml @@ -13,19 +13,19 @@ [Windows.Foundation.Metadata.Activatable(1)] - ///[Windows.Foundation.Metadata.Activatable(1)] + /// [Windows.Foundation.Metadata.Activatable(1)] [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] - ///[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] + /// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)] [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] - ///[Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] + /// [Windows.Foundation.Metadata.Threading(Windows.Foundation.Metadata.ThreadingModel.Both)] [Windows.Foundation.Metadata.Version(1)] - ///[Windows.Foundation.Metadata.Version(1)] + /// [Windows.Foundation.Metadata.Version(1)] @@ -44,7 +44,7 @@ [Windows.Foundation.Metadata.Overload("CreateInstance1")] - ///[Windows.Foundation.Metadata.Overload("CreateInstance1")] + /// [Windows.Foundation.Metadata.Overload("CreateInstance1")] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Color1.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Color1.xml index 9391c51bc..87873a92c 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Color1.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/Color1.xml @@ -12,7 +12,7 @@ [Windows.Foundation.Metadata.Version(1)] - ///[Windows.Foundation.Metadata.Version(1)] + /// [Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/CustomAttribute1.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/CustomAttribute1.xml index e11dccb08..470f07862 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/CustomAttribute1.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/CustomAttribute1.xml @@ -12,7 +12,7 @@ [Windows.Foundation.Metadata.Version(1)] - ///[Windows.Foundation.Metadata.Version(1)] + /// [Windows.Foundation.Metadata.Version(1)] @@ -31,7 +31,7 @@ [Windows.Foundation.Metadata.Overload("CreateInstance1")] - ///[Windows.Foundation.Metadata.Overload("CreateInstance1")] + /// [Windows.Foundation.Metadata.Overload("CreateInstance1")] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandler.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandler.xml index 0c31f60a3..35d636277 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandler.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandler.xml @@ -11,11 +11,11 @@ [Windows.Foundation.Metadata.Guid(1538629431, 28309, 13279, 150, 105, 205, 62, 250, 110, 149, 1)] - ///[Windows.Foundation.Metadata.Guid(1538629431, 28309, 13279, 150, 105, 205, 62, 250, 110, 149, 1)] + /// [Windows.Foundation.Metadata.Guid(1538629431, 28309, 13279, 150, 105, 205, 62, 250, 110, 149, 1)] [Windows.Foundation.Metadata.Version(1)] - ///[Windows.Foundation.Metadata.Version(1)] + /// [Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandlerWithSpecificType.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandlerWithSpecificType.xml index e473774d2..7e6730829 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandlerWithSpecificType.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/PrimeFoundHandlerWithSpecificType.xml @@ -11,11 +11,11 @@ [Windows.Foundation.Metadata.Guid(603281085, 10445, 12788, 160, 94, 209, 35, 22, 179, 109, 110)] - ///[Windows.Foundation.Metadata.Guid(603281085, 10445, 12788, 160, 94, 209, 35, 22, 179, 109, 110)] + /// [Windows.Foundation.Metadata.Guid(603281085, 10445, 12788, 160, 94, 209, 35, 22, 179, 109, 110)] [Windows.Foundation.Metadata.Version(1)] - ///[Windows.Foundation.Metadata.Version(1)] + /// [Windows.Foundation.Metadata.Version(1)] diff --git a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/SomethingHappenedEventHandler.xml b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/SomethingHappenedEventHandler.xml index 3c7330f6f..b2e3e9e64 100644 --- a/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/SomethingHappenedEventHandler.xml +++ b/mdoc/Test/ex.expected-cppwinrtuwp/UwpTestWinRtComponentCpp/SomethingHappenedEventHandler.xml @@ -11,11 +11,11 @@ [Windows.Foundation.Metadata.Guid(2298425249, 32140, 14992, 141, 140, 226, 207, 230, 43, 42, 170)] - ///[Windows.Foundation.Metadata.Guid(2298425249, 32140, 14992, 141, 140, 226, 207, 230, 43, 42, 170)] + /// [Windows.Foundation.Metadata.Guid(2298425249, 32140, 14992, 141, 140, 226, 207, 230, 43, 42, 170)] [Windows.Foundation.Metadata.Version(1)] - ///[Windows.Foundation.Metadata.Version(1)] + /// [Windows.Foundation.Metadata.Version(1)] From 46c93c4e09cac2aaa4d27448ec1db255abc902d3 Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Fri, 24 Jul 2020 15:09:58 +0800 Subject: [PATCH 13/18] Added space between '///' and '[' in CppWinRtAttributeFormatter --- .../AttributeFormatters/CppWinRtAttributeFormatter.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs index 90a1ee15d..d02dfcc24 100644 --- a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs +++ b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs @@ -8,7 +8,7 @@ namespace Mono.Documentation.Updater.Formatters { class CppWinRtAttributeFormatter : AttributeFormatter { - public override string PrefixBrackets { get; } = "///["; + public override string PrefixBrackets { get; } = "/// ["; public override string SurfixBrackets { get; } = "]"; public override string Language => Consts.CppWinRt; } From a51839b18fdc2dacbdc61646282976840aa659c8 Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Fri, 24 Jul 2020 15:19:37 +0800 Subject: [PATCH 14/18] Updated tests. --- .../Mono.DocTest.Generic/Func`2.xml | 10 +++--- .../Mono.DocTest.Generic/GenericBase`1.xml | 2 +- .../Mono.DocTest.Generic/MyList`1.xml | 2 +- .../Mono.DocTest/DocAttribute.xml | 2 +- .../Mono.DocTest/Widget+Direction.xml | 2 +- .../CustomNamespace/ClassEnumerator.xml | 2 +- .../CustomNamespace/ClassEnumerator.xml | 2 +- .../CustomNamespace/ClassEnumerator.xml | 2 +- .../Mono.DocTest.Generic/Func`2.xml | 10 +++--- .../Mono.DocTest.Generic/GenericBase`1.xml | 2 +- .../Mono.DocTest.Generic/MyList`1.xml | 2 +- .../en.expected/Mono.DocTest/DocAttribute.xml | 2 +- .../Mono.DocTest/Widget+Direction.xml | 2 +- mdoc/Test/en.expected/Mono.DocTest/Widget.xml | 32 +++++++++---------- 14 files changed, 37 insertions(+), 37 deletions(-) diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/Func`2.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/Func`2.xml index 794c1683c..9fe7a5a4d 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/Func`2.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/Func`2.xml @@ -10,7 +10,7 @@ [Mono.DocTest.Doc("arg!")] - ///[Mono.DocTest.Doc("arg!")] + /// [Mono.DocTest.Doc("arg!")] @@ -22,7 +22,7 @@ [Mono.DocTest.Doc("ret!")] - ///[Mono.DocTest.Doc("ret!")] + /// [Mono.DocTest.Doc("ret!")] @@ -36,7 +36,7 @@ [Mono.DocTest.Doc("method")] - ///[Mono.DocTest.Doc("method")] + /// [Mono.DocTest.Doc("method")] @@ -44,7 +44,7 @@ [Mono.DocTest.Doc("arg-actual")] - ///[Mono.DocTest.Doc("arg-actual")] + /// [Mono.DocTest.Doc("arg-actual")] @@ -54,7 +54,7 @@ [Mono.DocTest.Doc("return", Field=false)] - ///[Mono.DocTest.Doc("return", Field=false)] + /// [Mono.DocTest.Doc("return", Field=false)] diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/GenericBase`1.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/GenericBase`1.xml index f4304b05a..0f52ab69b 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/GenericBase`1.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/GenericBase`1.xml @@ -49,7 +49,7 @@ [Mono.DocTest.Doc("S")] - ///[Mono.DocTest.Doc("S")] + /// [Mono.DocTest.Doc("S")] diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/MyList`1.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/MyList`1.xml index b7518edec..f16eff4d2 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/MyList`1.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest.Generic/MyList`1.xml @@ -10,7 +10,7 @@ [Mono.DocTest.Doc("Type Parameter!")] - ///[Mono.DocTest.Doc("Type Parameter!")] + /// [Mono.DocTest.Doc("Type Parameter!")] diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/DocAttribute.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/DocAttribute.xml index 3152d17a3..b5db4de60 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/DocAttribute.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/DocAttribute.xml @@ -12,7 +12,7 @@ [System.AttributeUsage(System.AttributeTargets.All)] - ///[System.AttributeUsage(System.AttributeTargets.All)] + /// [System.AttributeUsage(System.AttributeTargets.All)] diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget+Direction.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget+Direction.xml index ee9625791..f12f0158d 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget+Direction.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget+Direction.xml @@ -12,7 +12,7 @@ [System.Flags] - ///[System.Flags] + /// [System.Flags] diff --git a/mdoc/Test/en.expected-eii-implementation-ecmadoc/CustomNamespace/ClassEnumerator.xml b/mdoc/Test/en.expected-eii-implementation-ecmadoc/CustomNamespace/ClassEnumerator.xml index 0a067453b..e7faa3427 100644 --- a/mdoc/Test/en.expected-eii-implementation-ecmadoc/CustomNamespace/ClassEnumerator.xml +++ b/mdoc/Test/en.expected-eii-implementation-ecmadoc/CustomNamespace/ClassEnumerator.xml @@ -101,7 +101,7 @@ [System.STAThread] [<System.STAThread>] - ///[System.STAThread] + /// [System.STAThread] diff --git a/mdoc/Test/en.expected-eii-implementation-slashdoc/CustomNamespace/ClassEnumerator.xml b/mdoc/Test/en.expected-eii-implementation-slashdoc/CustomNamespace/ClassEnumerator.xml index 2119a48c4..a2f914e09 100644 --- a/mdoc/Test/en.expected-eii-implementation-slashdoc/CustomNamespace/ClassEnumerator.xml +++ b/mdoc/Test/en.expected-eii-implementation-slashdoc/CustomNamespace/ClassEnumerator.xml @@ -105,7 +105,7 @@ [System.STAThread] [<System.STAThread>] - ///[System.STAThread] + /// [System.STAThread] diff --git a/mdoc/Test/en.expected-eii-implementation/CustomNamespace/ClassEnumerator.xml b/mdoc/Test/en.expected-eii-implementation/CustomNamespace/ClassEnumerator.xml index 70e82e050..84a4e52c9 100644 --- a/mdoc/Test/en.expected-eii-implementation/CustomNamespace/ClassEnumerator.xml +++ b/mdoc/Test/en.expected-eii-implementation/CustomNamespace/ClassEnumerator.xml @@ -101,7 +101,7 @@ [System.STAThread] [<System.STAThread>] - ///[System.STAThread] + /// [System.STAThread] diff --git a/mdoc/Test/en.expected/Mono.DocTest.Generic/Func`2.xml b/mdoc/Test/en.expected/Mono.DocTest.Generic/Func`2.xml index e936db516..a76141e45 100644 --- a/mdoc/Test/en.expected/Mono.DocTest.Generic/Func`2.xml +++ b/mdoc/Test/en.expected/Mono.DocTest.Generic/Func`2.xml @@ -15,7 +15,7 @@ [Mono.DocTest.Doc("arg!")] [<Mono.DocTest.Doc("arg!")>] - ///[Mono.DocTest.Doc("arg!")] + /// [Mono.DocTest.Doc("arg!")] @@ -28,7 +28,7 @@ [Mono.DocTest.Doc("ret!")] [<Mono.DocTest.Doc("ret!")>] - ///[Mono.DocTest.Doc("ret!")] + /// [Mono.DocTest.Doc("ret!")] @@ -43,7 +43,7 @@ [Mono.DocTest.Doc("method")] [<Mono.DocTest.Doc("method")>] - ///[Mono.DocTest.Doc("method")] + /// [Mono.DocTest.Doc("method")] @@ -52,7 +52,7 @@ [Mono.DocTest.Doc("arg-actual")] [<Mono.DocTest.Doc("arg-actual")>] - ///[Mono.DocTest.Doc("arg-actual")] + /// [Mono.DocTest.Doc("arg-actual")] @@ -63,7 +63,7 @@ [Mono.DocTest.Doc("return", Field=false)] [<Mono.DocTest.Doc("return", Field=false)>] - ///[Mono.DocTest.Doc("return", Field=false)] + /// [Mono.DocTest.Doc("return", Field=false)] diff --git a/mdoc/Test/en.expected/Mono.DocTest.Generic/GenericBase`1.xml b/mdoc/Test/en.expected/Mono.DocTest.Generic/GenericBase`1.xml index c4474afb3..083daab50 100644 --- a/mdoc/Test/en.expected/Mono.DocTest.Generic/GenericBase`1.xml +++ b/mdoc/Test/en.expected/Mono.DocTest.Generic/GenericBase`1.xml @@ -63,7 +63,7 @@ [Mono.DocTest.Doc("S")] [<Mono.DocTest.Doc("S")>] - ///[Mono.DocTest.Doc("S")] + /// [Mono.DocTest.Doc("S")] diff --git a/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml b/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml index 9b9d5844c..ef270948d 100644 --- a/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml +++ b/mdoc/Test/en.expected/Mono.DocTest.Generic/MyList`1.xml @@ -15,7 +15,7 @@ [Mono.DocTest.Doc("Type Parameter!")] [<Mono.DocTest.Doc("Type Parameter!")>] - ///[Mono.DocTest.Doc("Type Parameter!")] + /// [Mono.DocTest.Doc("Type Parameter!")] diff --git a/mdoc/Test/en.expected/Mono.DocTest/DocAttribute.xml b/mdoc/Test/en.expected/Mono.DocTest/DocAttribute.xml index d3cc3ceae..e86f97630 100644 --- a/mdoc/Test/en.expected/Mono.DocTest/DocAttribute.xml +++ b/mdoc/Test/en.expected/Mono.DocTest/DocAttribute.xml @@ -18,7 +18,7 @@ [System.AttributeUsage(System.AttributeTargets.All)] [<System.AttributeUsage(System.AttributeTargets.All)>] - ///[System.AttributeUsage(System.AttributeTargets.All)] + /// [System.AttributeUsage(System.AttributeTargets.All)] diff --git a/mdoc/Test/en.expected/Mono.DocTest/Widget+Direction.xml b/mdoc/Test/en.expected/Mono.DocTest/Widget+Direction.xml index b51ae29c0..d484879f2 100644 --- a/mdoc/Test/en.expected/Mono.DocTest/Widget+Direction.xml +++ b/mdoc/Test/en.expected/Mono.DocTest/Widget+Direction.xml @@ -17,7 +17,7 @@ [System.Flags] [<System.Flags>] - ///[System.Flags] + /// [System.Flags] diff --git a/mdoc/Test/en.expected/Mono.DocTest/Widget.xml b/mdoc/Test/en.expected/Mono.DocTest/Widget.xml index aaa466623..dc163e8de 100644 --- a/mdoc/Test/en.expected/Mono.DocTest/Widget.xml +++ b/mdoc/Test/en.expected/Mono.DocTest/Widget.xml @@ -104,17 +104,17 @@ [Mono.DocTest.Doc("Del event")] [<Mono.DocTest.Doc("Del event")>] - ///[Mono.DocTest.Doc("Del event")] + /// [Mono.DocTest.Doc("Del event")] [add: Mono.DocTest.Doc("Del add accessor")] [<add: Mono.DocTest.Doc("Del add accessor")>] - ///[add: Mono.DocTest.Doc("Del add accessor")] + /// [add: Mono.DocTest.Doc("Del add accessor")] [remove: Mono.DocTest.Doc("Del remove accessor")] [<remove: Mono.DocTest.Doc("Del remove accessor")>] - ///[remove: Mono.DocTest.Doc("Del remove accessor")] + /// [remove: Mono.DocTest.Doc("Del remove accessor")] @@ -400,7 +400,7 @@ [System.Obsolete("why not")] [<System.Obsolete("why not")>] - ///[System.Obsolete("why not")] + /// [System.Obsolete("why not")] @@ -490,7 +490,7 @@ [Mono.DocTest.Doc("Height property")] [<Mono.DocTest.Doc("Height property")>] - ///[Mono.DocTest.Doc("Height property")] + /// [Mono.DocTest.Doc("Height property")] @@ -518,12 +518,12 @@ [Mono.DocTest.Doc("Item property")] [<Mono.DocTest.Doc("Item property")>] - ///[Mono.DocTest.Doc("Item property")] + /// [Mono.DocTest.Doc("Item property")] [set: Mono.DocTest.Doc("Item property set accessor")] [<set: Mono.DocTest.Doc("Item property set accessor")>] - ///[set: Mono.DocTest.Doc("Item property set accessor")] + /// [set: Mono.DocTest.Doc("Item property set accessor")] @@ -605,7 +605,7 @@ [Mono.DocTest.Doc("normal DocAttribute", Field=true)] [<Mono.DocTest.Doc("normal DocAttribute", Field=true)>] - ///[Mono.DocTest.Doc("normal DocAttribute", Field=true)] + /// [Mono.DocTest.Doc("normal DocAttribute", Field=true)] @@ -614,7 +614,7 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] [<Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))>] - ///[Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] + /// [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] @@ -624,7 +624,7 @@ [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] [<Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)>] - ///[Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] + /// [Mono.DocTest.Doc("c", FlagsEnum=System.ConsoleModifiers.Alt | System.ConsoleModifiers.Control)] @@ -633,7 +633,7 @@ [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] [<Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)>] - ///[Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] + /// [Mono.DocTest.Doc("f", NonFlagsEnum=Mono.DocTest.Color.Red)] @@ -642,7 +642,7 @@ [Mono.DocTest.Doc("v")] [<Mono.DocTest.Doc("v")>] - ///[Mono.DocTest.Doc("v")] + /// [Mono.DocTest.Doc("v")] @@ -785,7 +785,7 @@ [System.ParamArray] [<System.ParamArray>] - ///[System.ParamArray] + /// [System.ParamArray] @@ -1063,17 +1063,17 @@ [Mono.DocTest.Doc("Width property")] [<Mono.DocTest.Doc("Width property")>] - ///[Mono.DocTest.Doc("Width property")] + /// [Mono.DocTest.Doc("Width property")] [get: Mono.DocTest.Doc("Width get accessor")] [<get: Mono.DocTest.Doc("Width get accessor")>] - ///[get: Mono.DocTest.Doc("Width get accessor")] + /// [get: Mono.DocTest.Doc("Width get accessor")] [set: Mono.DocTest.Doc("Width set accessor")] [<set: Mono.DocTest.Doc("Width set accessor")>] - ///[set: Mono.DocTest.Doc("Width set accessor")] + /// [set: Mono.DocTest.Doc("Width set accessor")] From d1b259dc7401a03c7e31b77cb7ff6b69e6587473 Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Mon, 27 Jul 2020 10:14:29 +0800 Subject: [PATCH 15/18] Made get attribute string language specific for C++WinRt --- .../AttributeFormatters/AttributeFormatter.cs | 17 ++--- .../CppWinRtAttributeFormatter.cs | 64 ++++++++++++++++++- 2 files changed, 66 insertions(+), 15 deletions(-) diff --git a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs index dbc0c324c..7aeb4ef71 100644 --- a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs +++ b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs @@ -90,10 +90,7 @@ public virtual bool TryGetAttributeString(CustomAttribute attribute, out string for (int i = 0; i < attribute.ConstructorArguments.Count; ++i) { CustomAttributeArgument argument = attribute.ConstructorArguments[i]; - string attributesValue = MakeAttributesValueString(argument.Value, argument.Type); - if (Language == Consts.CppWinRt && attributesValue.StartsWith("typeof(")) - attributesValue = attributesValue.Substring(7, attributesValue.Length - 8); - fields.Add(attributesValue); + fields.Add(MakeAttributesValueString(argument.Value, argument.Type)); } var namedArgs = (from namedArg in attribute.Fields @@ -102,12 +99,8 @@ public virtual bool TryGetAttributeString(CustomAttribute attribute, out string (from namedArg in attribute.Properties select new { Type = namedArg.Argument.Type, Name = namedArg.Name, Value = namedArg.Argument.Value })) .OrderBy(v => v.Name); - foreach (var d in namedArgs) { - string namedArgument = MakeNamedArgumentString(d.Name, MakeAttributesValueString(d.Value, d.Type)); - if (Language == Consts.CppWinRt && namedArgument.StartsWith("typeof(")) - namedArgument = namedArgument.Substring(7, namedArgument.Length - 8); - fields.Add(namedArgument); - } + foreach (var d in namedArgs) + fields.Add(MakeNamedArgumentString(d.Name, MakeAttributesValueString(d.Value, d.Type))); string a2 = String.Join(", ", fields.ToArray()); if (a2 != "") a2 = "(" + a2 + ")"; @@ -157,7 +150,7 @@ public static string MakeAttributesValueString(object v, TypeReference valueType throw new InvalidDataException(string.Format("Unable to format attribute value ({0})", v.ToString())); } - private bool IsIgnoredAttribute(CustomAttribute customAttribute) + protected bool IsIgnoredAttribute(CustomAttribute customAttribute) { // An Obsolete attribute with a known string is added to all ref-like structs // https://github.com/dotnet/csharplang/blob/master/proposals/csharp-7.2/span-safety.md#metadata-representation-or-ref-like-structs @@ -167,7 +160,7 @@ private bool IsIgnoredAttribute(CustomAttribute customAttribute) } // FIXME: get TypeReferences instead of string comparison? - private static string[] IgnorableAttributes = { + protected static string[] IgnorableAttributes = { // Security related attributes "System.Reflection.AssemblyKeyFileAttribute", "System.Reflection.AssemblyDelaySignAttribute", diff --git a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs index d02dfcc24..2ff4c46e6 100644 --- a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs +++ b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs @@ -1,8 +1,8 @@ using System; -using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; +using System.Collections.Generic; +using Mono.Cecil; +using Mono.Documentation.Util; namespace Mono.Documentation.Updater.Formatters { @@ -11,5 +11,63 @@ class CppWinRtAttributeFormatter : AttributeFormatter public override string PrefixBrackets { get; } = "/// ["; public override string SurfixBrackets { get; } = "]"; public override string Language => Consts.CppWinRt; + + public override bool TryGetAttributeString(CustomAttribute attribute, out string rval, string prefix = null, bool withBrackets = true) + { + if (attribute == null) + { + if (string.IsNullOrEmpty(prefix)) + { + rval = null; + return false; + } + rval = withBrackets ? PrefixBrackets + prefix + SurfixBrackets : prefix; + return true; + } + + if (IsIgnoredAttribute(attribute)) + { + rval = null; + return false; + } + + TypeDefinition attrType = attribute.AttributeType as TypeDefinition; + if (attrType != null && !DocUtils.IsPublic(attrType) + || (FormatterManager.SlashdocFormatter.GetName(attribute.AttributeType) == null) + || Array.IndexOf(IgnorableAttributes, attribute.AttributeType.FullName) >= 0) + { + rval = null; + return false; + } + + var fields = new List(); + + for (int i = 0; i < attribute.ConstructorArguments.Count; ++i) + { + CustomAttributeArgument argument = attribute.ConstructorArguments[i]; + string attributesValue = MakeAttributesValueString(argument.Value, argument.Type); + fields.Add(attributesValue.StartsWith("typeof(") ? attributesValue.Substring(7, attributesValue.Length - 8) : attributesValue); + } + var namedArgs = + (from namedArg in attribute.Fields + select new { Type = namedArg.Argument.Type, Name = namedArg.Name, Value = namedArg.Argument.Value }) + .Concat( + (from namedArg in attribute.Properties + select new { Type = namedArg.Argument.Type, Name = namedArg.Name, Value = namedArg.Argument.Value })) + .OrderBy(v => v.Name); + foreach (var d in namedArgs) { + string namedArgument = MakeNamedArgumentString(d.Name, MakeAttributesValueString(d.Value, d.Type)); + fields.Add(namedArgument.StartsWith("typeof(") ? namedArgument.Substring(7, namedArgument.Length - 8) : namedArgument); + } + + string a2 = String.Join(", ", fields.ToArray()); + if (a2 != "") a2 = "(" + a2 + ")"; + + string name = attribute.GetDeclaringType(); + if (name.EndsWith("Attribute")) name = name.Substring(0, name.Length - "Attribute".Length); + rval = withBrackets ? PrefixBrackets + prefix + name + a2 + SurfixBrackets + : prefix + name + a2; + return true; + } } } From 7c0a2453b91339346283331d39e62c97a95c27e5 Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Mon, 27 Jul 2020 15:08:09 +0800 Subject: [PATCH 16/18] Changed syntax --- .../Formatters/AttributeFormatters/AttributeFormatter.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs index 7aeb4ef71..552582710 100644 --- a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs +++ b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs @@ -90,7 +90,9 @@ public virtual bool TryGetAttributeString(CustomAttribute attribute, out string for (int i = 0; i < attribute.ConstructorArguments.Count; ++i) { CustomAttributeArgument argument = attribute.ConstructorArguments[i]; - fields.Add(MakeAttributesValueString(argument.Value, argument.Type)); + fields.Add(MakeAttributesValueString( + argument.Value, + argument.Type)); } var namedArgs = (from namedArg in attribute.Fields From c1ebe4c04691fc203423efc78e3b6ef3b1f8457a Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Tue, 28 Jul 2020 12:42:32 +0800 Subject: [PATCH 17/18] Updated MakeAttributesValueString --- .../AttributeFormatters/AttributeFormatter.cs | 6 +- .../CppWinRtAttributeFormatter.cs | 62 +------------------ .../Formatters/CSharpFullMemberFormatter.cs | 2 +- .../CppWinRtFullMemberFormatter.cs | 2 +- .../Formatters/VBFullMemberFormatter.cs | 2 +- 5 files changed, 9 insertions(+), 65 deletions(-) diff --git a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs index 552582710..1378675a1 100644 --- a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs +++ b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeFormatter.cs @@ -119,7 +119,7 @@ protected virtual string MakeNamedArgumentString(string name, string value) return $"{name}={value}"; } - public static string MakeAttributesValueString(object v, TypeReference valueType) + public virtual string MakeAttributesValueString(object v, TypeReference valueType) { var formatters = new[] { new AttributeValueFormatter (), @@ -152,7 +152,7 @@ public static string MakeAttributesValueString(object v, TypeReference valueType throw new InvalidDataException(string.Format("Unable to format attribute value ({0})", v.ToString())); } - protected bool IsIgnoredAttribute(CustomAttribute customAttribute) + private bool IsIgnoredAttribute(CustomAttribute customAttribute) { // An Obsolete attribute with a known string is added to all ref-like structs // https://github.com/dotnet/csharplang/blob/master/proposals/csharp-7.2/span-safety.md#metadata-representation-or-ref-like-structs @@ -162,7 +162,7 @@ protected bool IsIgnoredAttribute(CustomAttribute customAttribute) } // FIXME: get TypeReferences instead of string comparison? - protected static string[] IgnorableAttributes = { + private static string[] IgnorableAttributes = { // Security related attributes "System.Reflection.AssemblyKeyFileAttribute", "System.Reflection.AssemblyDelaySignAttribute", diff --git a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs index 2ff4c46e6..302249561 100644 --- a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs +++ b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/CppWinRtAttributeFormatter.cs @@ -1,8 +1,4 @@ -using System; -using System.Linq; -using System.Collections.Generic; using Mono.Cecil; -using Mono.Documentation.Util; namespace Mono.Documentation.Updater.Formatters { @@ -12,62 +8,10 @@ class CppWinRtAttributeFormatter : AttributeFormatter public override string SurfixBrackets { get; } = "]"; public override string Language => Consts.CppWinRt; - public override bool TryGetAttributeString(CustomAttribute attribute, out string rval, string prefix = null, bool withBrackets = true) + public override string MakeAttributesValueString(object v, TypeReference valueType) { - if (attribute == null) - { - if (string.IsNullOrEmpty(prefix)) - { - rval = null; - return false; - } - rval = withBrackets ? PrefixBrackets + prefix + SurfixBrackets : prefix; - return true; - } - - if (IsIgnoredAttribute(attribute)) - { - rval = null; - return false; - } - - TypeDefinition attrType = attribute.AttributeType as TypeDefinition; - if (attrType != null && !DocUtils.IsPublic(attrType) - || (FormatterManager.SlashdocFormatter.GetName(attribute.AttributeType) == null) - || Array.IndexOf(IgnorableAttributes, attribute.AttributeType.FullName) >= 0) - { - rval = null; - return false; - } - - var fields = new List(); - - for (int i = 0; i < attribute.ConstructorArguments.Count; ++i) - { - CustomAttributeArgument argument = attribute.ConstructorArguments[i]; - string attributesValue = MakeAttributesValueString(argument.Value, argument.Type); - fields.Add(attributesValue.StartsWith("typeof(") ? attributesValue.Substring(7, attributesValue.Length - 8) : attributesValue); - } - var namedArgs = - (from namedArg in attribute.Fields - select new { Type = namedArg.Argument.Type, Name = namedArg.Name, Value = namedArg.Argument.Value }) - .Concat( - (from namedArg in attribute.Properties - select new { Type = namedArg.Argument.Type, Name = namedArg.Name, Value = namedArg.Argument.Value })) - .OrderBy(v => v.Name); - foreach (var d in namedArgs) { - string namedArgument = MakeNamedArgumentString(d.Name, MakeAttributesValueString(d.Value, d.Type)); - fields.Add(namedArgument.StartsWith("typeof(") ? namedArgument.Substring(7, namedArgument.Length - 8) : namedArgument); - } - - string a2 = String.Join(", ", fields.ToArray()); - if (a2 != "") a2 = "(" + a2 + ")"; - - string name = attribute.GetDeclaringType(); - if (name.EndsWith("Attribute")) name = name.Substring(0, name.Length - "Attribute".Length); - rval = withBrackets ? PrefixBrackets + prefix + name + a2 + SurfixBrackets - : prefix + name + a2; - return true; + string baseValue = base.MakeAttributesValueString(v, valueType); + return baseValue.StartsWith("typeof(") ? baseValue.Substring(7, baseValue.Length - 8) : baseValue; } } } diff --git a/mdoc/Mono.Documentation/Updater/Formatters/CSharpFullMemberFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/CSharpFullMemberFormatter.cs index 746effe48..4dee7151b 100644 --- a/mdoc/Mono.Documentation/Updater/Formatters/CSharpFullMemberFormatter.cs +++ b/mdoc/Mono.Documentation/Updater/Formatters/CSharpFullMemberFormatter.cs @@ -547,7 +547,7 @@ private StringBuilder AppendParameter (StringBuilder buf, ParameterDefinition pa buf.Append (parameter.Name); if (parameter.HasDefault && parameter.IsOptional && parameter.HasConstant) { - var ReturnVal = AttributeFormatter.MakeAttributesValueString(parameter.Constant, parameter.ParameterType); + var ReturnVal = new AttributeFormatter().MakeAttributesValueString(parameter.Constant, parameter.ParameterType); buf.AppendFormat (" = {0}", ReturnVal == "null" ? "default" : ReturnVal); } return buf; diff --git a/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppWinRtFullMemberFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppWinRtFullMemberFormatter.cs index c03166710..c19696f31 100644 --- a/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppWinRtFullMemberFormatter.cs +++ b/mdoc/Mono.Documentation/Updater/Formatters/CppFormatters/CppWinRtFullMemberFormatter.cs @@ -103,7 +103,7 @@ protected override StringBuilder AppendParameter(StringBuilder buf, ParameterDef if (parameter.HasDefault && parameter.IsOptional && parameter.HasConstant) { - buf.AppendFormat(" = {0}", AttributeFormatter.MakeAttributesValueString(parameter.Constant, parameter.ParameterType)); + buf.AppendFormat(" = {0}", new AttributeFormatter().MakeAttributesValueString(parameter.Constant, parameter.ParameterType)); } return buf; diff --git a/mdoc/Mono.Documentation/Updater/Formatters/VBFullMemberFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/VBFullMemberFormatter.cs index 35cd47621..24f1a3fe4 100644 --- a/mdoc/Mono.Documentation/Updater/Formatters/VBFullMemberFormatter.cs +++ b/mdoc/Mono.Documentation/Updater/Formatters/VBFullMemberFormatter.cs @@ -584,7 +584,7 @@ private StringBuilder AppendParameter(StringBuilder buf, ParameterDefinition par buf.Append(GetTypeName(parameter.ParameterType, new DynamicParserContext(parameter))); if (parameter.HasDefault && parameter.IsOptional && parameter.HasConstant) { - var parameterValue = AttributeFormatter.MakeAttributesValueString(parameter.Constant, parameter.ParameterType); + var parameterValue = new AttributeFormatter().MakeAttributesValueString(parameter.Constant, parameter.ParameterType); buf.AppendFormat(" = {0}", parameterValue == "null" ? "Nothing" : parameterValue); } return buf; From bee1683016a722b0c15594292a9e4211cdf8ae1b Mon Sep 17 00:00:00 2001 From: Jeff Xu Date: Tue, 28 Jul 2020 14:06:56 +0800 Subject: [PATCH 18/18] Updated tests --- mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml | 2 +- mdoc/Test/en.expected/Mono.DocTest/Widget.xml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml index 7446bfad6..97ff0eb88 100644 --- a/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml +++ b/mdoc/Test/en.expected-cppwinrt2/Mono.DocTest/Widget.xml @@ -486,7 +486,7 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] - /// [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] + /// [Mono.DocTest.Doc("return:DocAttribute", Property=Mono.DocTest.Widget)] diff --git a/mdoc/Test/en.expected/Mono.DocTest/Widget.xml b/mdoc/Test/en.expected/Mono.DocTest/Widget.xml index dc163e8de..3d88d65c8 100644 --- a/mdoc/Test/en.expected/Mono.DocTest/Widget.xml +++ b/mdoc/Test/en.expected/Mono.DocTest/Widget.xml @@ -614,7 +614,7 @@ [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] [<Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))>] - /// [Mono.DocTest.Doc("return:DocAttribute", Property=typeof(Mono.DocTest.Widget))] + /// [Mono.DocTest.Doc("return:DocAttribute", Property=Mono.DocTest.Widget)]