Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/api-doc-tools.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXiao Luo <basehello@icloud.com>2021-03-18 12:22:39 +0300
committerXiao Luo <basehello@icloud.com>2021-03-18 12:22:39 +0300
commit282d8503c7c5ff8677e3d63c3c212d44c9d4f767 (patch)
treef830086bbdd9b2f23207b5b9c12f084ea265953b
parent68122d1c81081461e30a9e6b629b050b6cfa5f51 (diff)
-rw-r--r--mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeValueFormatter.cs11
-rw-r--r--mdoc/mdoc.Test/AttributeValueFormatterTest.cs4
2 files changed, 4 insertions, 11 deletions
diff --git a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeValueFormatter.cs b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeValueFormatter.cs
index 4c875d16..7eb2ff49 100644
--- a/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeValueFormatter.cs
+++ b/mdoc/Mono.Documentation/Updater/Formatters/AttributeFormatters/AttributeValueFormatter.cs
@@ -202,15 +202,8 @@ namespace Mono.Documentation.Updater
private string ConvertToType(TypeReference argumentType, object argumentValue)
{
- var typeFullName = string.Empty;
- if (argumentValue is TypeReference argumentValueType)
- {
- typeFullName = MDocUpdater.GetDocTypeFullName(argumentType);
- }
- else
- {
- typeFullName = MDocUpdater.GetDocTypeFullName(argumentType);
- }
+ var valueResult = GetArgumentValue("System.Type", argumentType, argumentValue);
+ var typeFullName = MDocUpdater.GetDocTypeFullName((TypeReference)valueResult);
return $"typeof({typeFullName})";
}
diff --git a/mdoc/mdoc.Test/AttributeValueFormatterTest.cs b/mdoc/mdoc.Test/AttributeValueFormatterTest.cs
index 1ed6ae87..3f57df65 100644
--- a/mdoc/mdoc.Test/AttributeValueFormatterTest.cs
+++ b/mdoc/mdoc.Test/AttributeValueFormatterTest.cs
@@ -14,7 +14,7 @@ namespace mdoc.Test
{
[TestCase("PropertyTypeType", "typeof(Mono.Cecil.TypeReference)")]
[TestCase("PropertyTypeTypeWithNull", "null")]
- [TestCase("PropertyTypeTypeWithNestedType", "typeof(mdoc.Test.SampleClasses.SomeNestedTypes/NestedClass)")]
+ [TestCase("PropertyTypeTypeWithNestedType", "typeof(mdoc.Test.SampleClasses.SomeNestedTypes+NestedClass)")]
[TestCase("PropertyBoolType", "true")]
[TestCase("PropertySByteType", SByte.MinValue)]
[TestCase("PropertyByteType", Byte.MaxValue)]
@@ -48,7 +48,7 @@ namespace mdoc.Test
[TestCase("PropertyArrayOfIntTypeWithNull", "null")]
[TestCase("PropertyObjectWithNull", "null")]
[TestCase("PropertyObjectWithTypeType", "typeof(Mono.Cecil.TypeReference)")]
- [TestCase("PropertyObjectWithNestedTypeType", "typeof(mdoc.Test.SampleClasses.SomeNestedTypes/NestedClass)")]
+ [TestCase("PropertyObjectWithNestedTypeType", "typeof(mdoc.Test.SampleClasses.SomeNestedTypes+NestedClass)")]
[TestCase("PropertyObjectWithBoolType", "true")]
[TestCase("PropertyObjectWithSByteType", SByte.MinValue)]
[TestCase("PropertyObjectWithByteType", Byte.MaxValue)]