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

Fix saving naming styles options page #34212

Merged
merged 3 commits into from
Mar 19, 2019

Conversation

JoeRobich
Copy link
Member

@JoeRobich JoeRobich commented Mar 18, 2019

  • Allow page controls to store settings to option store before updating service
  • Reload page control settings only after a cancel or save

Fixes #34210 which was introduced by #33523

The earlier PR didn't account for the Naming option page having very specialized load and save settings. Other option pages were updated to store their changes immediately into the OptionStore but Naming options still relied on SaveSettings being called to directly update the OptionService. In a related way, Naming service overwrites its view model when LoadSettings is called and because of the earlier change LoadSettings was being called every time the page is activated.

Ask Mode template

Customer scenario

User tries to update naming styles for identifiers and changes do not save.

Bugs this fixes

#34210

Workarounds, if any

None

Risk

Low

Performance impact

Low

Is this a regression from a previous update?

Yes, regression was introduced by #33523

Root cause analysis

In Dev16, option saving was rewritten so that all option changes went to a centralized store and were saved to the option service in a single location. This rewrite missed the custom save behavior of the Naming styles option page.

How was the bug found?

Reported through developer feedback

- Allow page controls to store settings to option store before updating service
- Reload page control settings after a cancel or save
@JoeRobich JoeRobich requested review from a team as code owners March 18, 2019 17:46
@@ -12,9 +12,6 @@
<TargetLatestRuntimePatch>false</TargetLatestRuntimePatch>
<SelfContained>true</SelfContained>

<!-- Do not build again when publishing -->
<NoBuild>true</NoBuild>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unrelated to the fix, but allows for builds in VS to not fail. This same change is already in the master branch.

@JoeRobich
Copy link
Member Author

@jasonmalinowski Could you please take a look?

Copy link
Contributor

@dpoeschl dpoeschl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes sense as a fix to the problems introduced previously.

src/VisualStudio/Core/Impl/Options/AbstractOptionPage.cs Outdated Show resolved Hide resolved
src/VisualStudio/Core/Impl/Options/AbstractOptionPage.cs Outdated Show resolved Hide resolved
@dpoeschl
Copy link
Contributor

dpoeschl commented Mar 18, 2019

Note: This has been tested by the test team and myself. Only one bug was found, which is unrelated and has existed since 15.x.

var oldOptions = s_optionService.GetOptions();
var newOptions = s_optionStore.GetOptions();
s_optionService.SetOptions(newOptions);
OptionLogger.Log(oldOptions, newOptions);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As pointed out by David offline, we had been logging option changes on SaveSettings before the earlier PR moved logging into the OptionStore. This reverts the behavior back.

@JoeRobich
Copy link
Member Author

Integration test failure was already logged as #33652

@JoeRobich JoeRobich merged commit 1101524 into dotnet:dev16.0 Mar 19, 2019
@JoeRobich JoeRobich deleted the fix-naming-options branch April 12, 2019 16:33
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.

4 participants