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:
authorJoel Martinez <joelmartinez@gmail.com>2019-09-19 00:01:22 +0300
committerJoel Martinez <joelmartinez@gmail.com>2019-09-19 00:01:22 +0300
commit692ce8139067a6916cab6381fdd1bd2a364b0f87 (patch)
tree6a131f3d00a59688af547e40fdf9b1c6346494bd
parentcd2743f83eef592aaf6472fcad9c11186d9aa133 (diff)
adjusted TimesProcessed logic on signatures.mdoc-5.7.4.11
By checking that there are any elements, it becomes slightly more acceptable of weird configurations where multiple versions of the same type exist in different assemblies, and members are added in the second instance
-rw-r--r--mdoc/Mono.Documentation/MDocUpdater.cs14
1 files changed, 9 insertions, 5 deletions
diff --git a/mdoc/Mono.Documentation/MDocUpdater.cs b/mdoc/Mono.Documentation/MDocUpdater.cs
index aa85d37a..93558df3 100644
--- a/mdoc/Mono.Documentation/MDocUpdater.cs
+++ b/mdoc/Mono.Documentation/MDocUpdater.cs
@@ -2367,19 +2367,23 @@ namespace Mono.Documentation
string elementName = "MemberSignature";
string elementXPath = $"{elementName}[@Language='" + formatter.Language + "']";
- Func<IEnumerable<XmlElement>> elementsQuery = () => xmlElement.SelectNodes(elementXPath).SafeCast<XmlElement>();
+ Func<IEnumerable<XmlElement>> elementsQuery = () => xmlElement.SelectNodes(elementXPath).SafeCast<XmlElement>().ToArray();
- if (typeEntry.TimesProcessed > 1)
+ var existingElements = elementsQuery();
+
+ if (typeEntry.TimesProcessed > 1 && existingElements.Any())
return;
// pre: clear all the signatures
if (typeEntry.IsMemberOnFirstFramework(member))
{
- foreach (var element in elementsQuery())// xmlElement.SelectNodes(elementName).SafeCast<XmlElement>())
+ foreach (var element in existingElements)// xmlElement.SelectNodes(elementName).SafeCast<XmlElement>())
{
// remove element
element.ParentNode.RemoveChild(element);
}
+
+ existingElements = elementsQuery();
}
if (valueToUse == null && usageSample == null)
@@ -2388,10 +2392,10 @@ namespace Mono.Documentation
bool elementFound = false;
// if exists, add fxa to it
- if (elementsQuery().Any())
+ if (existingElements.Any())
{
//var matchingElement = elementsQuery.Where(e => e.GetAttribute("Value") == valueToUse);
- foreach(var element in elementsQuery())
+ foreach(var element in existingElements)
{
var val = element.GetAttribute("Value");
var usage = element.GetAttribute("Usage");