Skip to content
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

Wait for solution to be loaded before initializing remote telemetry #74944

Merged
merged 15 commits into from
Aug 30, 2024

Conversation

CyrusNajmabadi
Copy link
Member

No description provided.

@CyrusNajmabadi CyrusNajmabadi requested a review from a team as a code owner August 29, 2024 17:48
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Aug 29, 2024

// Switch to a background thread to avoid loading option providers on UI thread (telemetry is reading options).
await TaskScheduler.Default;

var logDelta = _globalOptions.GetOption(DiagnosticOptionsStorage.LogTelemetryForBackgroundAnalyzerExecution);
var telemetryService = (VisualStudioWorkspaceTelemetryService)Services.GetRequiredService<IWorkspaceTelemetryService>();
telemetryService.InitializeTelemetrySession(telemetrySession, logDelta);
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was already running in the BG before. i'm just moving it earlier (where we're already on the BG) instead of having to jump back to bg to run this

@CyrusNajmabadi
Copy link
Member Author

Note: if WaitUntilFullyLoadedAsync doesn't work, then the following don't work:

  1. code actions
  2. designer attributes
  3. symbol search (which is also used as part of Add-Using, so that wouldn't work)
  4. change signature
  5. encapsulte field
  6. extract interface
  7. extract method
  8. rename
  9. call hierarchy

And likely much more. If this is not something we can depend on, then we have to fix that now. But having some new thing take a dependency on it doesn't substantively change things.

@CyrusNajmabadi
Copy link
Member Author

@jasonmalinowski @sharwell ptal.

@jasonmalinowski
Copy link
Member

Note: if WaitUntilFullyLoadedAsync doesn't work, then the following don't work:

@CyrusNajmabadi It's one of those things that can get broken from time to time, my worry was whether we'd end up with a bunch more broken stuff in that case. And even if it completes "eventually" that can still be after some amount of loading time, when I'd expect other features that might depend on OOP to be usable (like classification).

New approach looks good though!

@@ -133,9 +135,16 @@ private VisualStudioRemoteHostClientProvider(
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(leaving comment here because I can't do it elsewhere)

I like the "wait until launched" mechanism you're adding for uses like the SolutionChecksumUpdater, since it means that as a generic unrelated piece of code can wait. What I don't get though is why we're not just passing the telemetry settings here when we're creating the process, rather than assuming that other thing is going to run?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I don't get though is why we're not just passing the telemetry settings here when we're creating the process

i guess i don't understand. how would we get those telemetry settings? it seems like we need to be told about them. which is when we go and pusha ll fo this to the OOP side.

…rovider.cs

Co-authored-by: Jason Malinowski <jason@jason-m.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead VSCode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants