dotnet / razor

Compiler and tooling experience for Razor ASP.NET Core apps in Visual Studio, Visual Studio for Mac, and VS Code.
https://asp.net
MIT License
505 stars 195 forks source link

Add Telemetry Event / CodeMarker when Razor is ready #11232

Open WardenGnaw opened 12 hours ago

WardenGnaw commented 12 hours ago

Summary

Add a new event similar to dotnet/razor/taghelperresolve/end but is close to when Razor has completed discovering all of the razor components in a project,

Background and Motivation

During Automated Testing, when Visual Studio loads a solution, the LSP is running analysis in the background async. However, if the test infrastructure is trying to prevent regression of memory usage, things that happen asynchronously make it difficult to have a stable memory usage trace.

Right now, the tests are using Thread.Sleep(seconds) which is not the best way to capture regressions that may happen and not reliable.

This used to be done by https://github.com/dotnet/razor/pull/3110

Proposed Feature

Add a new event like dotnet/razor/taghelperresolve/end or a CodeMarker .

Alternative Designs

Some service that we can call that will wait when Razor is ready.

davidwengier commented 8 hours ago

Going to start this with an event telling us that the background document generator has nothing in its queue.