diff --git a/Src/Workspaces/Core/Log/ITelemetry.cs b/Src/Workspaces/Core/Log/ITelemetry.cs index 866d23ff76afd63380d105e914c84311bec996ba..d8c97e087db56dc76f71c149b8d25b3b0fcf158e 100644 --- a/Src/Workspaces/Core/Log/ITelemetry.cs +++ b/Src/Workspaces/Core/Log/ITelemetry.cs @@ -13,5 +13,6 @@ internal interface ITelemetryService : IWorkspaceService void EndCurrentSession(); void LogRenameSession(RenameSessionInfo renameSession); void LogLightBulbSession(LightBulbSessionInfo lightBulbSession); + void LogEncDebugSession(EncDebuggingSessionInfo session); } } diff --git a/Src/Workspaces/Core/Log/Telemetry.Parameters.cs b/Src/Workspaces/Core/Log/Telemetry.Parameters.cs index 2b61655042418b72543f34463870b54dd6b38d24..559eebff3f9ff84e6bd60422b82758601b2bc866 100644 --- a/Src/Workspaces/Core/Log/Telemetry.Parameters.cs +++ b/Src/Workspaces/Core/Log/Telemetry.Parameters.cs @@ -1,10 +1,9 @@ // Copyright (c) Microsoft Open Technologies, Inc. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; -using System.Diagnostics.CodeAnalysis; -using System.Linq; -using System.Threading; +using System.Collections.Generic; using Microsoft.CodeAnalysis.Options; +using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Internal.Log.Telemetry { @@ -86,4 +85,42 @@ internal struct LightBulbSessionInfo this.ExtendedFlagsOfSelectedItem = extendedFlagsOfSelectedItem; } } + + internal class EncDebuggingSessionInfo + { + public readonly List EditSessions = new List(); + public int EmptyEditSessions = 0; + + internal void EndEditSession(EncEditSessionInfo encEditSessionInfo) + { + if (encEditSessionInfo.IsEmpty()) + { + EmptyEditSessions++; + } + else + { + EditSessions.Add(encEditSessionInfo); + } + } + } + + internal class EncEditSessionInfo + { + public readonly HashSet> RudeEdits = new HashSet>(); + public IEnumerable EmitDeltaErrorIds; + public bool HadCompilationErrors; + public bool HadRudeEdits; + public bool HadValidChanges; + public bool HadValidInsignificantChanges; + + internal void LogRudeEdit(ushort kind, ushort syntaxKind) + { + RudeEdits.Add(ValueTuple.Create(kind, syntaxKind)); + } + + internal bool IsEmpty() + { + return !(HadCompilationErrors || HadRudeEdits || HadValidChanges || HadValidInsignificantChanges); + } + } } diff --git a/Src/Workspaces/Core/Log/TelemetryWorkspaceServiceFactory.cs b/Src/Workspaces/Core/Log/TelemetryWorkspaceServiceFactory.cs index 7187ab844e2413682d8d9af28e8c24238d75b34c..1afffa0dfeea1b4673094c00487bf8f5af734b0a 100644 --- a/Src/Workspaces/Core/Log/TelemetryWorkspaceServiceFactory.cs +++ b/Src/Workspaces/Core/Log/TelemetryWorkspaceServiceFactory.cs @@ -19,7 +19,7 @@ private class EmptyTelemetryLogger : ITelemetryService void ITelemetryService.EndCurrentSession() { } - + void ITelemetryService.LogLightBulbSession(Telemetry.LightBulbSessionInfo lightBulbSession) { } @@ -27,6 +27,10 @@ void ITelemetryService.LogLightBulbSession(Telemetry.LightBulbSessionInfo lightB void ITelemetryService.LogRenameSession(Telemetry.RenameSessionInfo renameSession) { } + + void ITelemetryService.LogEncDebugSession(Telemetry.EncDebuggingSessionInfo session) + { + } } } } diff --git a/Src/Workspaces/Core/Workspaces.csproj b/Src/Workspaces/Core/Workspaces.csproj index 3dac85da498b161d6f265e7605a0929c7461d0b4..d15e0f3dc60be9484dc0c1d7053b39aeea33db6e 100644 --- a/Src/Workspaces/Core/Workspaces.csproj +++ b/Src/Workspaces/Core/Workspaces.csproj @@ -522,7 +522,9 @@ - + + true +