Skip to content
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

Merged
merged 2 commits into from
Nov 8, 2018

Conversation

genlu
Copy link
Member

@genlu genlu commented Nov 6, 2018

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?

@genlu genlu requested a review from a team as a code owner November 6, 2018 21:59
@jcouv jcouv added the Area-IDE label Nov 6, 2018
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));
Copy link
Member

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).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup.

Copy link
Member

@jcouv jcouv left a 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!

@jinujoseph
Copy link
Contributor

lets keep for preview2 , holding this till the branch is ready

@genlu genlu closed this Nov 7, 2018
@genlu genlu reopened this Nov 7, 2018
@genlu
Copy link
Member Author

genlu commented Nov 7, 2018

@jinujoseph Seems P2 branch is open for business. Do I need anyone's approval to merge?

@jinujoseph
Copy link
Contributor

Approved to merge for 16.0.P2 once green

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants