-
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
[API proposal]: Unseal DiagnosticDescriptor
#62899
Comments
DiagnosticDescriptor
DiagnosticDescriptor
It wasn't |
@Youssef1313 I don't think this is possible or even desirable. Descriptors are used to create Diagnostic instances, and roslyn/src/Compilers/Core/Portable/Diagnostic/Diagnostic.cs Lines 295 to 298 in 87bf0d0
roslyn/src/Compilers/Core/Portable/Diagnostic/Diagnostic.cs Lines 165 to 278 in 87bf0d0
This also ensures that the DiagnosticDescriptor can be round-tripped across processes by all Roslyn layers, including the compiler layer. |
When using custom descriptors, we'll use the |
Background and Motivation
Currently, the only way to add custom information to a diagnostic descriptor is via custom tags, which is an
IEnumerable<string>
Proposed API
Usage Examples
The IDE could for example use an
internal class IdeDiagnosticDescriptor : DiagnosticDescriptor
that has extra information such as fading option, enforce on build values, etc.Currently enforce on build values are encoded as custom tags. But fading options are set to the whole analyzer.
Regardless of whether the IDE team is interested to do things that way, I can see other 3rd party analyzers making use of custom descriptors.
Alternative Designs
Risks
@mavasani @333fred What do you think?
The text was updated successfully, but these errors were encountered: