-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix IndexOutOfRange exception in InvocationExpressionSignatureHelpProvider #30997
Conversation
src/Features/CSharp/Portable/SignatureHelp/InvocationExpressionSignatureHelpProvider.cs
Outdated
Show resolved
Hide resolved
ConvertMethodGroupMethod(m, invocationExpression, semanticModel, symbolDisplayService, anonymousTypeDisplayService, documentationCommentFormattingService, cancellationToken)).ToList(); | ||
return (accessibleMethods.Select(m => | ||
ConvertMethodGroupMethod(m, invocationExpression, semanticModel, symbolDisplayService, anonymousTypeDisplayService, documentationCommentFormattingService, cancellationToken)).ToList(), | ||
TryGetSelectedIndex(accessibleMethods, currentSymbol)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TryGetSelectedIndex(accessibleMethods, currentSymbol) [](start = 16, length = 53)
📝 if I understood the change correctly, this is the crux of the fix. We're calling TryGetSelectedIndex
with accessibleMethods
rather than methodGroup
, so that the returned index is in bound of the relevant range (ie. that of accessibleMethods
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM (iteration 1). Thanks for finding and fixing this!
lets keep for preview2 , holding this till the branch is ready |
@jinujoseph Seems P2 branch is open for business. Do I need anyone's approval to merge? |
Approved to merge for 16.0.P2 once green |
FYI @dpoeschl @jcouv
I just found this issue while dogfooding, haven't filed a bug for it yet.
@jinujoseph Do we want this for P1?