From ef23a05edf4419cc5d2ba61af1e448d976e2dde4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mike=20Kr=C3=BCger?= Date: Tue, 9 Oct 2012 11:08:50 +0200 Subject: [PATCH] Fixed unit tests. --- .../Completion/CSharpCompletionEngine.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs b/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs index 3c1606b8e1..ec02c698c9 100644 --- a/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs +++ b/ICSharpCode.NRefactory.CSharp/Completion/CSharpCompletionEngine.cs @@ -662,11 +662,12 @@ namespace ICSharpCode.NRefactory.CSharp.Completion if (identifierStart.Node is VariableInitializer && location <= ((VariableInitializer)identifierStart.Node).NameToken.EndLocation) { return controlSpace ? HandleAccessorContext() ?? DefaultControlSpaceItems(identifierStart) : null; } - if (identifierStart.Node is CatchClause) { - if (((CatchClause)identifierStart.Node).VariableNameToken.Contains(location)) { + if (((CatchClause)identifierStart.Node).VariableNameToken.IsInside(location)) { return null; } + } + if (identifierStart.Node is AstType && identifierStart.Node.Parent is CatchClause) { return HandleCatchClauseType(identifierStart); } } @@ -990,7 +991,7 @@ namespace ICSharpCode.NRefactory.CSharp.Completion return type; return null; }; - if (identifierStart.Node is CatchClause) { + if (identifierStart.Node.Parent is CatchClause) { var wrapper = new CompletionDataWrapper(this); AddTypesAndNamespaces( wrapper,