Skip to content
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

Merged
merged 6 commits into from
May 26, 2016

Conversation

brettfo
Copy link
Member

@brettfo brettfo commented May 10, 2016

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

  • The existing code style options needed to be moved down from the features layer to the workspaces layer because that's where the analyzer and fixer for this./Me. live.
  • SimpleCodeStyleOption was renamed to CodeStyleOption<T> to allow for any option value type, although only bool is currently used.
  • The options UI now uses the new option and notification level and all of that is serialized appropriately and honored by the analyzer.

Contentious points

  • The old options (e.g., SimplificationOptions.QualifyFieldAccess) were obsoleted in favor of the new options (e.g., CodeStyleOptions.QualifyFieldAccess) because the old options were only simple bools, 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 to false. Does that mean NotificationOptions.None or Error or something more complicated?
  • There is also the possibility of leaving the existing SimplificationOptions.QualifyFieldAccess, etc. and supplementing them with additional options like CodeStyleOptions.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 existing var/keyword, etc., options are already coupled together and the inconsistency might kill me.

Still pending

  • Update internal integration tests.

@brettfo brettfo added Area-IDE PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. labels May 10, 2016
@brettfo brettfo added this to the 2.0 (Preview 1) milestone May 10, 2016
@brettfo brettfo removed the PR For Personal Review Only The PR doesn’t require anyone other than the developer to review it. label May 11, 2016
@brettfo
Copy link
Member Author

brettfo commented May 11, 2016

@dotnet/roslyn-ide for review

@brettfo brettfo changed the title [WIP] Use new UI for this./Me. and add a fix-all code action for qualification. Use new UI for this./Me. and add a fix-all code action for qualification. May 11, 2016
@@ -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,
Copy link
Member

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).

@Pilchie
Copy link
Member

Pilchie commented May 17, 2016

👍 Anyone else from @dotnet/roslyn-ide?

@brettfo brettfo force-pushed the prefer-this-notifications branch from f8a87ca to 386a406 Compare May 19, 2016 22:24
@brettfo
Copy link
Member Author

brettfo commented May 20, 2016

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.

@brettfo brettfo force-pushed the prefer-this-notifications branch from 386a406 to fe5dace Compare May 25, 2016 18:29
@brettfo
Copy link
Member Author

brettfo commented May 25, 2016

test vsi please

@brettfo brettfo force-pushed the prefer-this-notifications branch from fe5dace to 65431ed Compare May 25, 2016 23:46
@brettfo
Copy link
Member Author

brettfo commented May 26, 2016

FYI, the internal component of this PR is dotnet/roslyn-internal#1000.

@brettfo brettfo merged commit dbae4de into dotnet:future May 26, 2016
@brettfo brettfo deleted the prefer-this-notifications branch May 26, 2016 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants