In my extension, which I write for Visual Studio 2015, I want to change the tab size and the indent size, because at work we have a different setting when I develop an open source project (company history dating back to our C period). In my command class, I wrote the following code:
private const string CollectionPath = @"Text Editor\CSharp"; private void MenuItemCallback(object sender, EventArgs e) { var settingsManager = new ShellSettingsManager(ServiceProvider); var settingsStore = settingsManager.GetWritableSettingsStore(SettingsScope.UserSettings); var tabSize = settingsStore.GetInt32(CollectionPath, "Tab Size", -1); var indentSize = settingsStore.GetInt32(CollectionPath, "Indent Size", -1); if (tabSize != -1 && indentSize != -1) { settingsStore.SetInt32(CollectionPath, "Tab Size", 2); settingsStore.SetInt32(CollectionPath, "Indent Size", 2); } }
When testing in an experimental bush, it changes it during the passage of the method, but when you open the "Parameters" dialog, it retains the original values. When you debug again, the values ββremain original.
What did I forget or did wrong?
source share