Skip to content

Commit

Permalink
Fix TelemetryEventParams
Browse files Browse the repository at this point in the history
  • Loading branch information
andyleejordan committed Mar 24, 2021
1 parent f332ce1 commit 3ae17e8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions src/PowerShellEditorServices/Logging/PsesTelemetryEvent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
namespace Microsoft.PowerShell.EditorServices.Logging
{
// This inheirits from Dictionary so that it can be passed in to SendTelemetryEvent()
// which takes in an IDictionary<string, JToken>
// which takes in an IDictionary<string, object>
// However, I wanted creation to be easy so you can do
// new PsesTelemetryEvent { EventName = "eventName", Data = data }
internal class PsesTelemetryEvent : Dictionary<string, JToken>
internal class PsesTelemetryEvent : Dictionary<string, object>
{
public string EventName
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ private void SendFeatureChangesTelemetry(LanguageServerSettingsWrapper incomingS

_languageServer.Window.SendTelemetryEvent(new TelemetryEventParams
{
Data = new PsesTelemetryEvent
ExtensionData = new PsesTelemetryEvent
{
EventName = "NonDefaultPsesFeatureConfiguration",
Data = JObject.FromObject(configChanges)
Expand Down
4 changes: 2 additions & 2 deletions test/PowerShellEditorServices.Test.E2E/LSPTestsFixures.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ public async Task InitializeAsync()
.OnTelemetryEvent(telemetryEventParams => TelemetryEvents.Add(
new PsesTelemetryEvent
{
EventName = (string) telemetryEventParams.Data["eventName"],
Data = telemetryEventParams.Data["data"] as JObject
EventName = (string)telemetryEventParams.ExtensionData["eventName"],
Data = telemetryEventParams.ExtensionData["data"] as JObject
}));

// Enable all capabilities this this is for testing.
Expand Down

0 comments on commit 3ae17e8

Please sign in to comment.