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>"));
+ });
+ }
}
}