-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Fixup quick info for suppressed nullable operations. #79636
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
Conversation
@@ -12,8 +12,21 @@ namespace Microsoft.CodeAnalysis.LanguageService; | |||
|
|||
internal interface ISymbolDisplayService : ILanguageService | |||
{ | |||
Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ISymbol symbol, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default); | |||
Task<string> ToDescriptionStringAsync(SemanticModel semanticModel, int position, ImmutableArray<ISymbol> symbols, SymbolDescriptionOptions options, SymbolDescriptionGroups groups = SymbolDescriptionGroups.All, CancellationToken cancellationToken = default); |
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.
no need for these to be on the interface. they just defer to the other two methods on the type. moved these to be extensions.
protected virtual (NullableAnnotation, NullableFlowState) GetNullabilityAnalysis(SemanticModel semanticModel, ISymbol symbol, SyntaxNode node, CancellationToken cancellationToken) | ||
=> default; | ||
|
||
protected ImmutableArray<ISymbol> BindSymbols( |
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.
Broke BindToken into BindSymbols (just tries to get teh symbols corresponding to a token). That way that helper can be used when we decide to rebind speculatively when inside a suppression
? analysis | ||
: GetNullabilityAnalysis(semanticModel, symbol, bindableParent, cancellationToken); | ||
|
||
bool TryGetNullabilityAnalysisForSuppressedExpression(out (NullableAnnotation, NullableFlowState) analysis) |
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.
meat of the change. when we try to get nullability info, we first see if we're in a suppressed context, and fork the code so that the suppressions are gone. so we can see waht the lang would think was going on originally.
Fixes #42543