-
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
Use new UI for this.
/Me.
and add a fix-all code action for qualification.
#11227
Conversation
@dotnet/roslyn-ide for review |
this.
/Me.
and add a fix-all code action for qualification.this.
/Me.
and add a fix-all code action for qualification.
@@ -33,19 +34,46 @@ internal abstract class SimplifyTypeNamesDiagnosticAnalyzerBase<TLanguageKindEnu | |||
customTags: DiagnosticCustomTags.Unnecessary); | |||
|
|||
private static readonly LocalizableString s_localizableTitleRemoveThisOrMe = new LocalizableResourceString(nameof(FeaturesResources.RemoveQualification), FeaturesResources.ResourceManager, typeof(FeaturesResources)); | |||
private static readonly DiagnosticDescriptor s_descriptorRemoveThisOrMe = new DiagnosticDescriptor(IDEDiagnosticIds.RemoveQualificationDiagnosticId, | |||
private static readonly DiagnosticDescriptor s_descriptorRemoveThisOrMeHidden = new DiagnosticDescriptor(IDEDiagnosticIds.RemoveQualificationDiagnosticId, |
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.
If you look at the naming styles stuff, I think you can have a single DiagnosticDescriptor
and then return a different severity later (Just be careful, if your "defaultSeverity" is Hidden, then the anlayzer won't be run on closed files).
👍 Anyone else from @dotnet/roslyn-ide? |
f8a87ca
to
386a406
Compare
Rebased to fix merge conflicts. If nobody else has any complaints imma merge. Not really; I'm just trying to scare some reviews out of people. |
386a406
to
fe5dace
Compare
test vsi please |
fe5dace
to
65431ed
Compare
FYI, the internal component of this PR is dotnet/roslyn-internal#1000. |
High Level
This PR updates the
this.
/Me.
code style options to support the requested notification levels (None
,Info
,Warning
,Error
) and also enables a fix-all code action.Details
this.
/Me.
live.SimpleCodeStyleOption
was renamed toCodeStyleOption<T>
to allow for any option value type, although onlybool
is currently used.Contentious points
SimplificationOptions.QualifyFieldAccess
) were obsoleted in favor of the new options (e.g.,CodeStyleOptions.QualifyFieldAccess
) because the old options were only simplebool
s, but the new ones also manage their notification level. With this obsoletion, do we need to provide a way for the old option to migrate forward? Or since we're targeting a future release of VS can we simply delete the old options from the API? If we have to support the old options still, what should happen to the notification preference if I set the old option value tofalse
. Does that meanNotificationOptions.None
orError
or something more complicated?SimplificationOptions.QualifyFieldAccess
, etc. and supplementing them with additional options likeCodeStyleOptions.QualifyFieldAccessNotification
, but that feels weird for two reasons, 1) the options are coupled in the UI but de-coupled in the API; what's the mechanism for discoverability between the two? And 2) the existingvar
/keyword, etc., options are already coupled together and the inconsistency might kill me.Still pending