From d0950fd26539921f3dd31cafc419feecbe069931 Mon Sep 17 00:00:00 2001 From: Laszlo Paillat Date: Fri, 10 Apr 2020 18:07:42 +0200 Subject: [PATCH] fixed documentation generation for dynamic keyword (fixes #14) --- .../DefaultDocumentation.Release.csproj | 8 ++------ source/DefaultDocumentation/DefaultDocumentation.targets | 2 +- source/DefaultDocumentation/DocumentationWriter.cs | 1 + source/Dummy/DummyClass.cs | 2 +- source/Dummy/documentation/Dummy-DummyClass-this-int-.md | 4 ++-- 5 files changed, 7 insertions(+), 10 deletions(-) diff --git a/source/DefaultDocumentation/DefaultDocumentation.Release.csproj b/source/DefaultDocumentation/DefaultDocumentation.Release.csproj index a35a5efc..80b0f38a 100644 --- a/source/DefaultDocumentation/DefaultDocumentation.Release.csproj +++ b/source/DefaultDocumentation/DefaultDocumentation.Release.csproj @@ -7,13 +7,9 @@ - 0.6.0 + 0.6.1 -breaking change: -changed netcoreapp to v3.0 -do not generate base homepage if there is only one namespace present and no DefaultDocumentationHome specified nor any AssemblyDoc - -fixed operator documentation page overlapping names +fixed documentation generation for dynamic keyword \ No newline at end of file diff --git a/source/DefaultDocumentation/DefaultDocumentation.targets b/source/DefaultDocumentation/DefaultDocumentation.targets index e5f081bb..7948286e 100644 --- a/source/DefaultDocumentation/DefaultDocumentation.targets +++ b/source/DefaultDocumentation/DefaultDocumentation.targets @@ -12,8 +12,8 @@ - + diff --git a/source/DefaultDocumentation/DocumentationWriter.cs b/source/DefaultDocumentation/DocumentationWriter.cs index ec60b6be..f5d31c0c 100644 --- a/source/DefaultDocumentation/DocumentationWriter.cs +++ b/source/DefaultDocumentation/DocumentationWriter.cs @@ -93,6 +93,7 @@ string HandleParameterizedType(ParameterizedType genericType) TypeKind.Array when type is TypeWithElementType arrayType => GetTypeLink(item, arrayType.ElementType) + "System.Array".AsDotNetApiLink("[]"), TypeKind.ByReference when type is TypeWithElementType innerType => GetTypeLink(item, innerType.ElementType), TypeKind.TypeParameter => item.TryGetTypeParameterDocItem(type.Name, out TypeParameterDocItem typeParameter) ? GetInnerLink(typeParameter) : type.Name, + TypeKind.Dynamic => "[dynamic](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/types/using-type-dynamic 'dynamic')", _ when type is ParameterizedType genericType => HandleParameterizedType(genericType), _ => GetLink(type.GetDefinition().GetIdString()) }; diff --git a/source/Dummy/DummyClass.cs b/source/Dummy/DummyClass.cs index 41b83ba9..80f8d60f 100644 --- a/source/Dummy/DummyClass.cs +++ b/source/Dummy/DummyClass.cs @@ -42,7 +42,7 @@ public class DummyNested /// /// /// - public int this[int index] + public dynamic this[int index] { get => index; } diff --git a/source/Dummy/documentation/Dummy-DummyClass-this-int-.md b/source/Dummy/documentation/Dummy-DummyClass-this-int-.md index ddc64543..ebd0d927 100644 --- a/source/Dummy/documentation/Dummy-DummyClass-this-int-.md +++ b/source/Dummy/documentation/Dummy-DummyClass-this-int-.md @@ -2,7 +2,7 @@ ## DummyClass.this[int] Property dummy ```csharp -public int this[int index] { get; } +public dynamic this[int index] { get; } ``` #### Parameters @@ -10,4 +10,4 @@ public int this[int index] { get; } #### Property Value -[System.Int32](https://docs.microsoft.com/en-us/dotnet/api/System.Int32 'System.Int32') +[dynamic](https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/types/using-type-dynamic 'dynamic')