Don't block on global scope during ext startup#1456
Open
eleanorjboyd wants to merge 7 commits intomicrosoft:mainfrom
Open
Don't block on global scope during ext startup#1456eleanorjboyd wants to merge 7 commits intomicrosoft:mainfrom
eleanorjboyd wants to merge 7 commits intomicrosoft:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
This PR optimizes extension startup by avoiding blocking on global-scope environment resolution when at least one workspace folder environment has already been resolved, deferring the global resolution to a background task.
Changes:
- Defer global-scope environment selection to a background task when a workspace environment is available.
- Add telemetry for “blocking time” of initial environment selection, including whether global scope was deferred.
- Expand unit tests to cover error handling, deferral behavior, and additional settings-error warning paths.
Show a summary per file
| File | Description |
|---|---|
| src/features/interpreterSelection.ts | Defers global env resolution when a workspace env is resolved; adds completion telemetry and error-handling adjustments. |
| src/common/telemetry/constants.ts | Introduces a new telemetry event name + GDPR property mapping for env selection completion. |
| src/test/features/interpreterSelection.unit.test.ts | Adds tests for new deferral behavior and error/warning paths in environment selection. |
Copilot's findings
- Files reviewed: 3/3 changed files
- Comments generated: 4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When at least one workspace folder resolved successfully, don't await the global scope resolution. Run it as a background task instead of blocking startup on it.
For more than 3/4ths of slow sessions where the workspace env resolves fast (via
envPreResolved), this should make the status bar update near-instantly.Files opened outside the workspace folder wouldn't have a Python env immediately available. They would resolve moments later when the background task completes.