From f49dfb66ac20ebe29f287e9349e8a745f34b7f6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Sun, 3 Feb 2013 12:01:08 +0100 Subject: [PATCH] Fixed XML comment bug. --- .../Completion/CSharpCompletionEngine.cs | 2 +- .../DocumentationContextTests.cs | 32 ++++++++++++++++--- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs b/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs index 7616ae5e7b..b4f25cd15c 100644 --- a/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs +++ b/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs @@ -3027,7 +3027,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion if (startIndex >= 0) { int endIndex = startIndex; - while (endIndex + 1 < lineText.Length && lineText [endIndex] != '>' && !Char.IsWhiteSpace (lineText [endIndex + 1])) { + while (endIndex + 1 < lineText.Length && lineText [endIndex] != '>' && !char.IsWhiteSpace (lineText [endIndex])) { endIndex++; } string tag = endIndex - startIndex - 1 > 0 ? lineText.Substring( diff --git a/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/DocumentationContextTests.cs b/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/DocumentationContextTests.cs index daa78fbc70..86ca84ad10 100644 --- a/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/DocumentationContextTests.cs +++ b/ICSharpCode.NRefactory.Tests/CSharp/CodeCompletion/DocumentationContextTests.cs @@ -29,10 +29,10 @@ using NUnit.Framework; namespace ICSharpCode.NRefactory.CSharp.CodeCompletion { - [TestFixture()] + [TestFixture] public class DocumentationContextTests { - [Test()] + [Test] public void TestClosingTag() { CodeCompletionBugTests.CombinedProviderTest( @@ -50,11 +50,11 @@ public class Test }); } - [Test()] + [Test] public void TestClosingTagMultiLine() { CodeCompletionBugTests.CombinedProviderTest( -@"using System; + @"using System; public class Test { @@ -69,6 +69,30 @@ public class Test Assert.IsNotNull(provider.Find("/summary>")); }); } + + /// + /// Bug 9998 - Doc comments completion offers as end tag for + /// + [Test] + public void TestBug9998() + { + CodeCompletionBugTests.CombinedProviderTest( + @"using System; + +public class Test +{ + /// + /// + /// $<$ + public static void Main(string[] args) + { + + } +} +", provider => { + Assert.IsNotNull(provider.Find("/param>")); + }); + } } }