Skip to content

Commit

Permalink
fixed ValueTuple member handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Doraku committed May 30, 2020
1 parent 31717c1 commit 12612ea
Show file tree
Hide file tree
Showing 37 changed files with 74 additions and 526 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
<Version>0.6.6</Version>
<PackageReleaseNotes>
fixed pointer member handling
fixed ValueTuple member handling
</PackageReleaseNotes>
</PropertyGroup>
</Project>
8 changes: 8 additions & 0 deletions source/DefaultDocumentation/DocumentationWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,21 @@ string HandleParameterizedType(ParameterizedType genericType)
+ genericType.GenericType.ReflectionName.AsDotNetApiLink("&gt;");
}

string HandleTupleType(TupleType tupleType)
{
return tupleType.FullName.AsDotNetApiLink(tupleType.FullName + "&lt;")
+ string.Join(tupleType.FullName.AsDotNetApiLink(","), tupleType.ElementTypes.Select(GetTypeLink))
+ tupleType.FullName.AsDotNetApiLink("&gt;");
}

return type.Kind switch
{
TypeKind.Array when type is TypeWithElementType arrayType => GetTypeLink(arrayType.ElementType) + "System.Array".AsDotNetApiLink("[]"),
TypeKind.Pointer when type is TypeWithElementType pointerType => GetTypeLink(pointerType.ElementType) + "*",
TypeKind.ByReference when type is TypeWithElementType innerType => GetTypeLink(innerType.ElementType),
TypeKind.TypeParameter => _mainItem.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')",
TypeKind.Tuple when type is TupleType tupleType => HandleTupleType(tupleType),
_ when type is ParameterizedType genericType => HandleParameterizedType(genericType),
_ => GetLink(type.GetDefinition().GetIdString())
};
Expand Down
36 changes: 35 additions & 1 deletion source/Dummy/DummyClass.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Threading.Tasks;

namespace Dummy
{
Expand Down Expand Up @@ -47,6 +48,18 @@ public dynamic this[int index]
get => index;
}

/// <summary>
/// dummy
/// </summary>
/// <typeparam name="T">dummy</typeparam>
/// <param name="value">dummy</param>
/// <returns>dummy</returns>
public async Task<dynamic> DummyAsync<T>(T value)
{
await Task.Delay(0);
return value;
}

/// <summary>
/// dummy
/// </summary>
Expand All @@ -58,7 +71,7 @@ public DummyClass()
/// </summary>
/// <param name="p">dummy</param>
/// <returns>dummy</returns>
public unsafe int** Unsafe(int* p) => &p;
public unsafe int** Unsafe(void* p) => (int**)&p;

/// <summary>
/// dummy
Expand All @@ -71,6 +84,27 @@ public void DummyMethod<T2>(T2 pouet)
t += 0;
}

/// <summary>
/// dummy
/// </summary>
public TaskContinuationOptions DummyOption { get; }

/// <summary>
/// dummy
/// </summary>
/// <typeparam name="T2">dummy</typeparam>
/// <param name="pouet">dummy</param>
/// <returns>dummy</returns>
public (int, DummyClass) DummyTuple<T2>(T2 pouet) => (42, this);

/// <summary>
/// dummy
/// </summary>
/// <typeparam name="T2">dummy</typeparam>
/// <param name="pouet">dummy</param>
/// <returns>dummy</returns>
public ValueTuple<int, DummyClass> DummyExplicitTuple<T2>(T2 pouet) => (42, this);

/// <summary>
/// dummy
/// </summary>
Expand Down
6 changes: 0 additions & 6 deletions source/Dummy/documentation/Dummy-DummyClass-DummyClass().md

This file was deleted.

8 changes: 0 additions & 8 deletions source/Dummy/documentation/Dummy-DummyClass-DummyField.md

This file was deleted.

16 changes: 0 additions & 16 deletions source/Dummy/documentation/Dummy-DummyClass-DummyMethod-T2-(T2).md

This file was deleted.

This file was deleted.

23 changes: 0 additions & 23 deletions source/Dummy/documentation/Dummy-DummyClass-DummyNested-T-.md

This file was deleted.

8 changes: 0 additions & 8 deletions source/Dummy/documentation/Dummy-DummyClass-DummyProperty.md

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 12612ea

Please sign in to comment.