-
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 crash in sighelp #74510
Fix crash in sighelp #74510
Conversation
@@ -101,8 +101,8 @@ internal partial class Session | |||
currentModel.Provider == provider && | |||
currentModel.GetCurrentSpanInSubjectBuffer(disconnectedBufferGraph.SubjectBufferSnapshot).Span.Start == items.ApplicableSpan.Start && | |||
currentModel.Items.IndexOf(currentModel.SelectedItem) == items.SelectedItemIndex && | |||
currentModel.ArgumentIndex == items.ArgumentIndex && | |||
currentModel.ArgumentCount == items.ArgumentCount && |
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.
renamed these to make the distinction clear. 'argument count' refferred to how many explicit argument syntax nodes are present in the code. 'argument index' was very badly named. It indicated 'this is the parameter in the actual symcol we think the user is currently on'
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.
note: the pr is almost entirely this rename. i call out anything that isn't just that.
items.SyntacticArgumentCount, | ||
items.ArgumentName, | ||
selectedParameter: 0, | ||
userSelected); |
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.
just renames + wrapping. no other change.
model.SemanticParameterIndex, | ||
model.SyntacticArgumentCount, | ||
model.ArgumentName, | ||
isCaseSensitive); |
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.
just renames + wrapping. no other change.
int semanticParameterIndex, | ||
int syntacticArgumentCount, | ||
string name, | ||
bool isCaseSensitive) |
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.
just renames + wrapping. no other change.
public int SemanticParameterIndex { get; } | ||
|
||
/// <inheritdoc cref="SignatureHelpItems.SyntacticArgumentCount"/> | ||
public int SyntacticArgumentCount { get; } |
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.
just renames.
if (argumentCount < argumentIndex) | ||
{ | ||
throw new ArgumentException($"{nameof(argumentCount)} < {nameof(argumentIndex)}. {argumentCount} < {argumentIndex}", nameof(argumentIndex)); | ||
} |
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.
this was the crux of hte bug. a check that literally made no sense. the number of syntactic arguments provided has no basis on which semantic parameter we think is teh right one to select. It's just information about the syntax tree, that's all.
Thanks for fixing, this was for me the #1 most annoying/visible Roslyn bug for my usage in the past year or maybe more. |
Fixes #72012
Fixes #74500
Fixes #74383