diff options
Diffstat (limited to 'main/src')
-rw-r--r-- | main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterUtil.cs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterUtil.cs b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterUtil.cs index da6b5106cb..0acc4c4fa1 100644 --- a/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterUtil.cs +++ b/main/src/addins/CSharpBinding/MonoDevelop.CSharp.Features/ParameterHinting/ParameterUtil.cs @@ -70,7 +70,11 @@ namespace ICSharpCode.NRefactory6.CSharp int i = 0; int j = 0; - foreach (var child in invocation.ArgumentList.ChildNodesAndTokens ()) { + var argList = invocation.ArgumentList; + if (caretOffset < argList.SpanStart || caretOffset > argList.Span.End) + return ParameterIndexResult.Invalid; + + foreach (var child in argList.ChildNodesAndTokens ()) { if (child.Span.End > caretOffset) { if (i == 0 && j <= 1) return ParameterIndexResult.First; |