diff options
author | Joel Martinez <joelmartinez@gmail.com> | 2019-05-30 21:42:30 +0300 |
---|---|---|
committer | Joel Martinez <joelmartinez@gmail.com> | 2019-05-30 21:42:30 +0300 |
commit | 3e8ee82414f2bb46fc3118bc9f179b50d79bb6f1 (patch) | |
tree | b5b1a0bce7697b494b9b0eddb12984238aaff193 | |
parent | a4e407da93b38736e406538e8e9c1e9ea4fbea46 (diff) |
Updated parameter handling for modopt by refmarj-missingMembers2
-rw-r--r-- | mdoc/Mono.Documentation/MDocUpdater.cs | 18 | ||||
-rw-r--r-- | mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs | 18 |
2 files changed, 34 insertions, 2 deletions
diff --git a/mdoc/Mono.Documentation/MDocUpdater.cs b/mdoc/Mono.Documentation/MDocUpdater.cs index c96dc92a..5da12de2 100644 --- a/mdoc/Mono.Documentation/MDocUpdater.cs +++ b/mdoc/Mono.Documentation/MDocUpdater.cs @@ -3554,9 +3554,25 @@ namespace Mono.Documentation else e.InsertAfter (pe, nextTo); + if (paramType.EndsWith("&")) + paramType = paramType.Substring(0, paramType.Length - 1); + pe.SetAttribute ("Name", param.Name); pe.SetAttribute ("Type", paramType); - if (param.ParameterType is ByReferenceType) + + var paramTypeToUse = param.ParameterType; + if (paramTypeToUse is OptionalModifierType) + { + var optType = paramTypeToUse as OptionalModifierType; + paramTypeToUse = optType.ElementType; + } + else if (paramTypeToUse is RequiredModifierType) + { + var reqType = paramTypeToUse as RequiredModifierType; + paramTypeToUse = reqType.ElementType; + } + + if (paramTypeToUse is ByReferenceType) { if (param.IsOut) pe.SetAttribute ("RefType", "out"); diff --git a/mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs b/mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs index 33a4c6a1..6d30622a 100644 --- a/mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs +++ b/mdoc/Mono.Documentation/Updater/DocumentationEnumerator.cs @@ -134,7 +134,22 @@ namespace Mono.Documentation.Updater bool good = true; for (int i = 0; i < pis.Count; i++) { - bool isRefType = pis[i].ParameterType is ByReferenceType; + var mParamType = pis[i].ParameterType; + + bool isRefType = false; + + if (mParamType is ByReferenceType) + isRefType = true; + if (mParamType is OptionalModifierType) + { + var modopttype = mParamType as OptionalModifierType; + isRefType = modopttype.ElementType.IsByReference; + } + if (mParamType is RequiredModifierType) + { + var modreqtype = mParamType as RequiredModifierType; + isRefType = modreqtype.ElementType.IsByReference; + } string paramType = GetReplacedString ( MDocUpdater.GetDocParameterType (pis[i].ParameterType), @@ -158,6 +173,7 @@ namespace Mono.Documentation.Updater } xmlMemberType = xmlIsRefType ? xmlMemberType.Substring (0, xmlMemberType.Length - 1) : xmlMemberType; + paramType = isRefType ? paramType.Substring(0, paramType.Length - 1) : paramType; if ((!paramType.Equals (xmlMemberType) && paramType.Equals (originalParamType)) || (MDocUpdater.SwitchingToMagicTypes && !originalParamType.Equals (xmlMemberType) && !paramType.Equals (xmlMemberType) && !paramType.Equals (originalParamType))) |