-
Notifications
You must be signed in to change notification settings - Fork 196
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
Add Razor language server telemetry to C# DevKit #9283
Conversation
src/Razor/src/Microsoft.VisualStudio.Telemetry.Razor/TelemetryHelpers.cs
Outdated
Show resolved
Hide resolved
@@ -8,8 +8,8 @@ | |||
|
|||
<ItemGroup> | |||
<!-- Prepare for _UpdatePublishItems target. --> | |||
<_ItemsToPublish Include="$(ArtifactsPackagesDir)**\*.tgz" Condition="'$(OS)' == 'Windows_NT'" /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is leftover from O# and is no longer needed
@@ -41,4 +41,35 @@ | |||
<!-- Build a .zip file from each platform's directory and write it to 'artifacts' --> | |||
<ZipDirectory SourceDirectory="%(LanguageServiceBinary.SourceDir)" DestinationFile="%(LanguageServiceBinary.ZipFile)" /> | |||
</Target> | |||
|
|||
<Target Name="_ZipDevKitTelemetryBinaries" AfterTargets="_ZipLanguageServerBinaries" Condition="'$(ArcadeBuildFromSource)' != 'true'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We zip the files to publish to the CDN so we can consume the telemetry binaries on the vscode-csharp side.
@@ -0,0 +1,176 @@ | |||
// Copyright (c) .NET Foundation. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is almost entirely taken from Roslyn with a few modifications to make it work for Razor
@@ -0,0 +1,96 @@ | |||
// Copyright (c) .NET Foundation. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is almost entirely taken from Roslyn with a few modifications to make it work for Razor
@@ -0,0 +1,72 @@ | |||
// Copyright (c) .NET Foundation. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class is almost entirely taken from Roslyn with a few modifications to make it work for Razor
src/Razor/src/Microsoft.VisualStudio.DevKit.Razor/DevKitTelemetryReporter.cs
Outdated
Show resolved
Hide resolved
using System.Diagnostics; | ||
using Microsoft.VisualStudio.Telemetry; | ||
|
||
namespace Microsoft.AspNetCore.Razor.Telemetry; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These were classes previously in TelemetryReporter
that I refactored out so they could be used by both VSTelemetryReporter
and DevKitTelemetryReporter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't have a lot of context, but this makes sense to me. Well, except for the MEF and ALC stuff :)
src/Razor/src/Microsoft.VisualStudio.DevKit.Razor/DevKitTelemetryReporter.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.DevKit.Razor/Microsoft.VisualStudio.DevKit.Razor.csproj
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Exports/AssemblyLoadContextWrapper.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Exports/ExportProviderBuilder.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.DevKit.Razor/DevKitTelemetryReporter.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.DevKit.Razor/DevKitTelemetryReporter.cs
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.DevKit.Razor/Microsoft.VisualStudio.DevKit.Razor.csproj
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.VisualStudio.DevKit.Razor/Microsoft.VisualStudio.DevKit.Razor.csproj
Outdated
Show resolved
Hide resolved
src/Razor/src/Microsoft.AspNetCore.Razor.LanguageServer/Exports/AssemblyLoadContextWrapper.cs
Outdated
Show resolved
Hide resolved
@@ -1,318 +0,0 @@ | |||
// Copyright (c) .NET Foundation. All rights reserved. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This class became VSTelemetryReporter
, and mutual logic between it and DevKitTelemetryReporter
was moved to an abstract class called TelemetryReporter
|
||
public override void InitializeSession(string telemetryLevel, string? sessionId, bool isDefaultSession) | ||
{ | ||
// We don't need to do anything here. We're using the default session |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably throw it at least assert this isn't called
vscode-csharp PR: dotnet/vscode-csharp#6371
Adds Razor server telemetry to C# DevKit. The flow is as follows:
Microsoft.VisualStudio.DevKit.Razor
, which contains our VS telemetry logic.