Nullness :: Render C# code analysis attributes in tooltips #17485
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
C# offers a selection of attributes for API authors that guide the compiler in nullable flow analysis:
https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/attributes/nullable-analysis
F# compiler does not do flow analysis, but these attributes are a good source of contract documentation.
Even when they are processed, there is value in showing them to developers as part of QuickInfo tooltips.
As of now, the selection is filtered for all attributes coming from System.Diagnostics.CodeAnalysis namespace.
Typical APIs where this is present in BCL are added in tooltip tests (see tests in this PR).
This covers among others:
Please let me know of there are styles of API design with those attributes worth testing and covering
(i.e. real world usages of those attributes beyond the already tested attribute targets - method, method return type, method parameter)
Addresses: #17402