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:
authorMichael Jin <v-michaeljin@microsoft.com>2021-06-04 17:11:37 +0300
committerGitHub <noreply@github.com>2021-06-04 17:11:37 +0300
commit48abb77384f62ebe735be3475433528af4a2a1ce (patch)
tree5c0c293b31abe7e14bc827bf54d3fb1a8d1e6321 /mdoc/Mono.Documentation/MDocUpdater.cs
parent749ae75e190d6ce65ce23c6ad5be3b45bc9eb414 (diff)
mdoc should not use TypeMap for parameter and return elements (#558)
https://ceapex.visualstudio.com/Engineering/_workitems/edit/427756 Co-authored-by: anmeng10101 <33647870+anmeng10101@users.noreply.github.com>
Diffstat (limited to 'mdoc/Mono.Documentation/MDocUpdater.cs')
-rw-r--r--mdoc/Mono.Documentation/MDocUpdater.cs15
1 files changed, 9 insertions, 6 deletions
diff --git a/mdoc/Mono.Documentation/MDocUpdater.cs b/mdoc/Mono.Documentation/MDocUpdater.cs
index 47b50d40..9dcaebb1 100644
--- a/mdoc/Mono.Documentation/MDocUpdater.cs
+++ b/mdoc/Mono.Documentation/MDocUpdater.cs
@@ -932,7 +932,7 @@ namespace Mono.Documentation
private static string GetTypeFileName (TypeReference type)
{
- return filenameFormatter.GetName (type);
+ return filenameFormatter.GetName (type, useTypeProjection: false);
}
public static string GetTypeFileName (string typename)
@@ -4208,19 +4208,22 @@ namespace Mono.Documentation
else throw new ArgumentException ();
}
- public static string GetDocParameterType (TypeReference type)
+ public static string GetDocParameterType (TypeReference type, bool useTypeProjection = false)
{
- var typename = GetDocTypeFullName (type).Replace ("@", "&");
-
- typename = MDocUpdater.Instance.TypeMap?.GetTypeName("C#", typename) ?? typename;
+ var typename = GetDocTypeFullName (type, useTypeProjection).Replace ("@", "&");
+ if (useTypeProjection || string.IsNullOrEmpty(typename))
+ {
+ typename = MDocUpdater.Instance.TypeMap?.GetTypeName("C#", typename) ?? typename;
+ }
+
return typename;
}
private void MakeReturnValue (FrameworkTypeEntry typeEntry, XmlElement root, TypeReference type, MemberReference member, IList<CustomAttribute> attributes, bool shouldDuplicateWithNew = false)
{
XmlElement e = WriteElement (root, "ReturnValue");
- var valueToUse = GetDocTypeFullName (type);
+ var valueToUse = GetDocTypeFullName (type, false);
if ((type.IsRequiredModifier && ((RequiredModifierType)type).ElementType.IsByReference)
|| type.IsByReference)
e.SetAttribute("RefType", "Ref");