From e0ee8bf286f23315ad7345f83f460e7f11741df4 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 1 Feb 2020 08:55:21 +0100 Subject: [PATCH] Revert "Fix #1908: Add option to AddXmlDocumentationTransform to remove newlines in comments" This reverts commit 104392436609772aa51e98c1a57c4e7abae3e5fa. --- .../Transforms/AddXmlDocumentationTransform.cs | 9 ++------- ICSharpCode.Decompiler/DecompilerSettings.cs | 16 ---------------- 2 files changed, 2 insertions(+), 23 deletions(-) diff --git a/ICSharpCode.Decompiler/CSharp/Transforms/AddXmlDocumentationTransform.cs b/ICSharpCode.Decompiler/CSharp/Transforms/AddXmlDocumentationTransform.cs index ba81c05dc4..490dcdc336 100644 --- a/ICSharpCode.Decompiler/CSharp/Transforms/AddXmlDocumentationTransform.cs +++ b/ICSharpCode.Decompiler/CSharp/Transforms/AddXmlDocumentationTransform.cs @@ -19,8 +19,10 @@ using System; using System.IO; using System.Linq; +using System.Reflection.Metadata; using System.Xml; using ICSharpCode.Decompiler.CSharp.Syntax; +using ICSharpCode.Decompiler.Documentation; using ICSharpCode.Decompiler.TypeSystem; namespace ICSharpCode.Decompiler.CSharp.Transforms @@ -41,13 +43,6 @@ public void Run(AstNode rootNode, TransformContext context) continue; string doc = provider.GetDocumentation(entity); if (doc != null) { - if (context.Settings.RemoveLineBreaksInXmlDocumentation) { - string[] lines = doc.Split(new[] { '\r', '\n' }, StringSplitOptions.RemoveEmptyEntries); - for (int i = 0; i < lines.Length; i++) { - lines[i] = lines[i].Trim(); - } - doc = string.Join(" ", lines); - } InsertXmlDocumentation(entityDecl, new StringReader(doc)); } } diff --git a/ICSharpCode.Decompiler/DecompilerSettings.cs b/ICSharpCode.Decompiler/DecompilerSettings.cs index 86e14d04c4..95eb3fcb70 100644 --- a/ICSharpCode.Decompiler/DecompilerSettings.cs +++ b/ICSharpCode.Decompiler/DecompilerSettings.cs @@ -722,22 +722,6 @@ public bool ShowXmlDocumentation { } } - bool removeLineBreaksInXmlDocumentation = false; - - /// - /// Gets/Sets whether to remove line breaks from XML documentation comments. - /// - [Browsable(false)] - public bool RemoveLineBreaksInXmlDocumentation { - get { return removeLineBreaksInXmlDocumentation; } - set { - if (removeLineBreaksInXmlDocumentation != value) { - removeLineBreaksInXmlDocumentation = value; - OnPropertyChanged(); - } - } - } - bool foldBraces = false; [Browsable(false)]