From 1e8057c8ee68c64f4236ebe3e2bd7ef544bfb541 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 13 Nov 2010 18:16:28 +0100 Subject: [PATCH] fixed http://community.sharpdevelop.net/forums/t/12237.aspx --- .../Project/Src/CompletionDataHelper.cs | 2 +- src/Main/Base/Test/VBExpressionFinderTests.cs | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/AddIns/BackendBindings/VBNetBinding/Project/Src/CompletionDataHelper.cs b/src/AddIns/BackendBindings/VBNetBinding/Project/Src/CompletionDataHelper.cs index e56429d219..5add897538 100644 --- a/src/AddIns/BackendBindings/VBNetBinding/Project/Src/CompletionDataHelper.cs +++ b/src/AddIns/BackendBindings/VBNetBinding/Project/Src/CompletionDataHelper.cs @@ -37,7 +37,7 @@ namespace ICSharpCode.VBNetBinding if (expressionResult.Context == ExpressionContext.Importable && string.IsNullOrWhiteSpace(expressionResult.Expression)) { expressionResult.Expression = "Global"; - } else if (pressedKey != '.') { + } else if (pressedKey == '\0') { int idx = string.IsNullOrWhiteSpace(expressionResult.Expression) ? -1 : expressionResult.Expression.LastIndexOf('.'); diff --git a/src/Main/Base/Test/VBExpressionFinderTests.cs b/src/Main/Base/Test/VBExpressionFinderTests.cs index 8eadfd7301..330256b877 100644 --- a/src/Main/Base/Test/VBExpressionFinderTests.cs +++ b/src/Main/Base/Test/VBExpressionFinderTests.cs @@ -202,6 +202,19 @@ End Class", "Test2", ExpressionContext.Default); End Sub End Class", "Double", ExpressionContext.MethodBody); } + + [Test] + public void FindExpressionAfterWordBegin() + { + Find(@"Class MainClass + Dim test As Integer + Sub Main() + If Me.test i| Then + + End If + End Sub +End Class", "i", ExpressionContext.Default); + } #endregion #region Context Tests