Log keybinding reset events.

上级 e4cb91ea
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
using Microsoft.CodeAnalysis.Internal.Log;
namespace Microsoft.CodeAnalysis.Experimentation
{
internal static class KeybindingsResetLogger
{
private const string Name = "KeybindingsResetDetector";
public static void Log(string action)
{
Logger.Log(FunctionId.Experiment_KeybindingsReset, KeyValueLogMessage.Create(LogType.UserAction, m =>
{
m[nameof(Name)] = Name;
m[nameof(action)] = action;
}));
}
}
}
......@@ -230,6 +230,7 @@ private void ShowGoldBar()
throw ExceptionUtilities.Unreachable;
}
KeybindingsResetLogger.Log("InfoBarShown");
var infoBarService = _workspace.Services.GetRequiredService<IInfoBarService>();
infoBarService.ShowInfoBarInGlobalView(
message,
......@@ -261,6 +262,8 @@ private void RestoreVsKeybindings()
(uint)OLECMDEXECOPT.OLECMDEXECOPT_DODEFAULT,
null));
KeybindingsResetLogger.Log("KeybindingsReset");
_workspace.Options = _workspace.Options.WithChangedOption(KeybindingResetOptions.NeedsReset, false);
}
......@@ -269,6 +272,7 @@ private void OpenExtensionsHyperlink()
ThisCanBeCalledOnAnyThread();
Process.Start(KeybindingsFwLink);
KeybindingsResetLogger.Log("ExtensionsLink");
_workspace.Options = _workspace.Options.WithChangedOption(KeybindingResetOptions.NeedsReset, false);
}
......@@ -277,6 +281,7 @@ private void NeverShowAgain()
AssertIsForeground();
_workspace.Options = _workspace.Options.WithChangedOption(KeybindingResetOptions.NeverShowAgain, true);
KeybindingsResetLogger.Log("NeverShowAgain");
// The only external references to this object are as callbacks, which are removed by the dispose method.
Dispose();
......
......@@ -400,5 +400,6 @@ internal enum FunctionId
AssetStorage_ForceGC,
RemoteHost_Bitness,
Intellisense_Completion,
Experiment_KeybindingsReset
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册