-
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
Add AdditionalTextValueProvider<TValue>
#68092
Add AdditionalTextValueProvider<TValue>
#68092
Conversation
@dotnet/roslyn-compiler ptal. This was approved in last API review meeting. |
Ping @dotnet/roslyn-compiler . Simple PR :) |
@@ -1,6 +1,11 @@ | |||
*REMOVED*static Microsoft.CodeAnalysis.SeparatedSyntaxList<TNode>.implicit operator Microsoft.CodeAnalysis.SeparatedSyntaxList<TNode!>(Microsoft.CodeAnalysis.SeparatedSyntaxList<Microsoft.CodeAnalysis.SyntaxNode!> nodes) -> Microsoft.CodeAnalysis.SeparatedSyntaxList<TNode!> | |||
*REMOVED*static Microsoft.CodeAnalysis.SyntaxList<TNode>.implicit operator Microsoft.CodeAnalysis.SyntaxList<TNode!>(Microsoft.CodeAnalysis.SyntaxList<Microsoft.CodeAnalysis.SyntaxNode!> nodes) -> Microsoft.CodeAnalysis.SyntaxList<TNode!> | |||
Microsoft.CodeAnalysis.Compilation.SupportsRuntimeCapability(Microsoft.CodeAnalysis.RuntimeCapability capability) -> bool | |||
Microsoft.CodeAnalysis.Diagnostics.AdditionalTextValueProvider<TValue> | |||
Microsoft.CodeAnalysis.Diagnostics.AdditionalTextValueProvider<TValue>.AdditionalTextValueProvider(System.Func<Microsoft.CodeAnalysis.AdditionalText!, TValue>! computeValue, System.Collections.Generic.IEqualityComparer<Microsoft.CodeAnalysis.AdditionalText!>? additionalTextComparer = null) -> void | |||
Microsoft.CodeAnalysis.Diagnostics.AnalysisContext.TryGetValue<TValue>(Microsoft.CodeAnalysis.AdditionalText! text, Microsoft.CodeAnalysis.Diagnostics.AdditionalTextValueProvider<TValue>! valueProvider, out TValue value) -> bool |
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.
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.
Yes. The clear intent (and approval from api review) was simply that thsi mirror the existing SyntaxTree/SourceText providers, which this falls under.
@dotnet/roslyn-compiler for another pair of eyes please. |
@dotnet/roslyn-compiler @333fred ptal. |
Fixes #67611
This API acts the same as the existing SyntaxTreeValueProvider and SourceTextValueProvider. These helpers allow diagnostic analzyers to cache data associated with a particular tree, 'source text', and now 'additional text', ensuring that they don't have to recompute that same data across analysis calls if the associated item is unchanged.
This helps analyzers avoid having to figure out how to do this themselves (including having to go down potentially problematic paths, like managing their own conditional weak tables).