Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
70ab306
The basic implementation of identifying attribute value.
hiihellox10 Mar 5, 2021
d71588e
Refactoring and improve AttributeValueFormatter class and add some te…
hiihellox10 Mar 12, 2021
8714db4
Add support for all attribute parameter types and add test cases for …
hiihellox10 Mar 15, 2021
2e1c70f
Add support for some special enum types, there are Apple platform fla…
hiihellox10 Mar 16, 2021
1b30111
Fix issue of the integration tests in pipiline.
hiihellox10 Mar 16, 2021
4fc2216
Remove the test codes use to check not found assembly.
hiihellox10 Mar 16, 2021
be034b4
Fix if flags type has an unknown value zero that the value can't be c…
hiihellox10 Mar 17, 2021
489d3a4
Add support for nested types and add test cases for this. and refacto…
hiihellox10 Mar 17, 2021
de9ca21
Fix the full name of nested types are not convert to correctly full n…
hiihellox10 Mar 17, 2021
acc6b60
Don't need to convert the special character '+' or '/' in the full na…
hiihellox10 Mar 17, 2021
46b3b6b
Refactoring.
hiihellox10 Mar 18, 2021
2080b68
Normalize code style.
hiihellox10 Mar 18, 2021
a371024
Fix the Type property of the nested types and generic type in an attr…
hiihellox10 Mar 19, 2021
a3334a7
Refactoring.
hiihellox10 Mar 22, 2021
07fcbfc
Improve typeof operator for the generic type with not pass any parame…
hiihellox10 Mar 22, 2021
9c82a6c
Update expected XML file for nested types.
hiihellox10 Mar 22, 2021
7b11a97
Update comments for unbound generic types.
hiihellox10 Mar 22, 2021
bded0cc
Refactoring.
hiihellox10 Mar 22, 2021
39c01b7
Improve typeof operator with unbound generic type.
hiihellox10 Mar 23, 2021
e81a7ec
Remove unnecessary arguments.
hiihellox10 Mar 23, 2021
4066aaf
Add support for typeof operator with unbound nested generic type and …
hiihellox10 Mar 25, 2021
2d01f48
Add support for IteratorStateMachineAttribute and add test cases for …
hiihellox10 Mar 26, 2021
e064674
Refactoring.
hiihellox10 Mar 29, 2021
3947eb5
Fix the combinations of values that have duplicate values.
hiihellox10 Apr 2, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions mdoc/Mono.Documentation/MDocUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4407,9 +4407,9 @@ private static string GetDocTypeName (TypeReference type, bool useTypeProjection
return docTypeFormatter.GetName (type, useTypeProjection: useTypeProjection);
}

internal static string GetDocTypeFullName (TypeReference type, bool useTypeProjection = true)
internal static string GetDocTypeFullName (TypeReference type, bool useTypeProjection = true, bool isTypeofOperator = false)
{
return DocTypeFullMemberFormatter.Default.GetName (type, useTypeProjection: useTypeProjection);
return DocTypeFullMemberFormatter.Default.GetName (type, useTypeProjection: useTypeProjection, isTypeofOperator: isTypeofOperator);
}

internal static string GetXPathForMember (DocumentationMember member)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
using Mono.Documentation.Util;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;

namespace Mono.Documentation.Updater.Formatters
{
public class AttributeFormatter
{
private AttributeValueFormatter valueFormatter = new AttributeValueFormatter();

public virtual string PrefixBrackets { get; } = "";
public virtual string SurfixBrackets { get; } = "";
public virtual string Language { get; } = "";
Expand Down Expand Up @@ -119,37 +120,9 @@ protected virtual string MakeNamedArgumentString(string name, string value)
return $"{name}={value}";
}

public virtual string MakeAttributesValueString(object v, TypeReference valueType)
public virtual string MakeAttributesValueString(object argumentValue, TypeReference argumentType)
{
var formatters = new[] {
new AttributeValueFormatter (),
new ApplePlatformEnumFormatter (),
new StandardFlagsEnumFormatter (),
new DefaultAttributeValueFormatter (),
};

ResolvedTypeInfo type = new ResolvedTypeInfo(valueType);

if (valueType is ArrayType && v is CustomAttributeArgument[])
{
ArrayType atype = valueType as ArrayType;
CustomAttributeArgument[] args = v as CustomAttributeArgument[];
var returnvalue = $"new {atype.FullName}{(atype.FullName.EndsWith("[]") ? "" : "[]")} {{ { string.Join(", ", args.Select(a => MakeAttributesValueString(a.Value, a.Type)).ToArray()) } }}";
return returnvalue;
}

foreach (var formatter in formatters)
{
string formattedValue;
if (formatter.TryFormatValue(v, type, out formattedValue))
{
return formattedValue;
}
}

// this should never occur because the DefaultAttributeValueFormatter will always
// successfully format the value ... but this is needed to satisfy the compiler :)
throw new InvalidDataException(string.Format("Unable to format attribute value ({0})", v.ToString()));
return valueFormatter.Format(argumentType, argumentValue);
}

private bool IsIgnoredAttribute(CustomAttribute customAttribute)
Expand Down
Loading