diff options
author | Michael Jin <v-michaeljin@microsoft.com> | 2022-05-16 10:49:50 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-16 10:49:50 +0300 |
commit | eb7fec62c3ec4759ae178bd601564aa4f4d66ed6 (patch) | |
tree | 111266f7f546cef41cfe83481eb70b78c903dcaa /mdoc | |
parent | 4505169ef62adeba69632bd98f95ded090a4c7bc (diff) |
Fix the logic for the shouldDelete factor (#628)
* Fix the logic for the shouldDelete factor
* Fix cmd for integration test
* Make duplication a considered factor in the deleting
Diffstat (limited to 'mdoc')
-rw-r--r-- | mdoc/Makefile | 4 | ||||
-rw-r--r-- | mdoc/Mono.Documentation/MDocUpdater.cs | 4 |
2 files changed, 5 insertions, 3 deletions
diff --git a/mdoc/Makefile b/mdoc/Makefile index 22899c9e..6d4b9615 100644 --- a/mdoc/Makefile +++ b/mdoc/Makefile @@ -751,7 +751,7 @@ check-monodocer-attached-entities: # now make sure it will delete a previously run/duplicated attachedproperty/property cp Test/AttachedEventsAndProperties/AttachedPropertyExample.xml Test/en.actual/AttachedEventsAndProperties/ - $(MONO) $(PROGRAM) update -o Test/en.actual Test/AttachedEventsAndProperties/bin/Release/AttachedEventsAndProperties.dll -lang docid -lang vb.net -lang fsharp -lang javascript -lang c++/cli -lang c++/cx -lang c++/winrt + $(MONO) $(PROGRAM) update -o Test/en.actual Test/AttachedEventsAndProperties/bin/Release/AttachedEventsAndProperties.dll --delete -lang docid -lang vb.net -lang fsharp -lang javascript -lang c++/cli -lang c++/cx -lang c++/winrt $(DIFF) Test/en.expected-attached-entities Test/en.actual Test/TestClass.dll: @@ -765,7 +765,7 @@ check-monodocer-operators-work: Test/TestClass.dll rm -Rf Test/en.actual $(MONO) $(PROGRAM) update Test/TestClass.dll -o Test/en.actual cp mdoc.Test/SampleClasses/TestClass-OldOpSig.xml Test/en.actual/mdoc.Test.SampleClasses/TestClass.xml - $(MONO) $(PROGRAM) update Test/TestClass.dll -o Test/en.actual + $(MONO) $(PROGRAM) update Test/TestClass.dll -o Test/en.actual --delete .PHONY: check-monodocer-operators check-monodocer-operators: check-monodocer-operators-work diff --git a/mdoc/Mono.Documentation/MDocUpdater.cs b/mdoc/Mono.Documentation/MDocUpdater.cs index 487730a6..8b858edd 100644 --- a/mdoc/Mono.Documentation/MDocUpdater.cs +++ b/mdoc/Mono.Documentation/MDocUpdater.cs @@ -1939,9 +1939,11 @@ namespace Mono.Documentation signature); // Identify all of the different states that could affect our decision to delete the member + bool duplicated = reason.Contains("Duplicate Member"); bool shouldPreserve = !string.IsNullOrWhiteSpace (PreserveTag); bool hasContent = MemberDocsHaveUserContent (member); - bool shouldDelete = !shouldPreserve && (delete || !hasContent); + //When the member is NOT PRESERVED, the member has NO CONTENT or is DUPLICATED, then it should be deleted + bool shouldDelete = !shouldPreserve && (delete && (!hasContent || duplicated)); bool unifiedRun = HasDroppedNamespace (type); |