From 4eeb77a15e27c724bd2f6dcb9e5721913dd6ff70 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Tue, 5 Feb 2013 09:38:10 +0100 Subject: [PATCH] Fixed potential exception. NOTE: The code completion engine isn't ment to insert text - this functionality should be moved to the IDE on-the-fly formatting/indentation backend. --- .../Completion/CSharpCompletionEngine.cs | 26 +------------------ 1 file changed, 1 insertion(+), 25 deletions(-) diff --git a/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs b/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs index 48166ac79c..a580094f01 100644 --- a/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs +++ b/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs @@ -334,7 +334,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion } return null; } - + IEnumerable MagicKeyCompletion(char completionChar, bool controlSpace) { Tuple resolveResult; @@ -366,30 +366,6 @@ namespace ICSharpCode.NRefactory.CSharp.Completion } return null; } - string lineText = document.GetText(document.GetLineByNumber(location.Line)); - int startIndex = Math.Min(location.Column - 1, lineText.Length - 1); - while (startIndex >= 0 && lineText [startIndex] != '<') { - --startIndex; - if (lineText [startIndex] == '/') { - // already closed. - startIndex = -1; - break; - } - } - - if (startIndex >= 0) { - int endIndex = startIndex; - while (endIndex <= location.Column && endIndex < lineText.Length && !Char.IsWhiteSpace (lineText [endIndex])) { - endIndex++; - } - string tag = endIndex - startIndex - 1 > 0 ? lineText.Substring( - startIndex + 1, - endIndex - startIndex - 2 - ) : null; - if (!string.IsNullOrEmpty(tag) && commentTags.IndexOf(tag) >= 0) { - document.Insert(offset, "", AnchorMovementType.BeforeInsertion); - } - } return null; // Parameter completion