@@ -751,6 +751,34 @@ function createDefaultProject(workspaceUri) {
751751}
752752```
753753
754+ ** Workspaces Without Environment Extension:**
755+
756+ When the Python Environments extension is not available or returns no projects:
757+
758+ 1 . ** Detection** : ` discoverWorkspaceProjects() ` catches API errors or empty results
759+ 2 . ** Fallback Strategy** : Calls ` createDefaultProject(workspaceUri) ` which:
760+ - Uses the workspace's active interpreter via ` interpreterService.getActiveInterpreter() `
761+ - Creates a mock ` PythonProject ` with workspace URI as project root
762+ - Generates a project ID from the workspace URI: ` default-{workspaceUri.fsPath} `
763+ - Mimics the legacy single-workspace behavior, but wrapped in ` ProjectAdapter ` structure
764+
765+ 3 . ** Key Characteristics** :
766+ - Single project per workspace (legacy behavior preserved)
767+ - No project scoping in test IDs (projectId is optional in resolver)
768+ - Uses workspace-level Python interpreter settings
769+ - All tests belong to this single "default" project
770+ - Fully compatible with existing test discovery/execution flows
771+
772+ 4 . ** Graceful Upgrade Path** :
773+ - When user later installs the Python Environments extension, next discovery will:
774+ - Detect actual Python projects in the workspace
775+ - Replace the default project with real project adapters
776+ - Rebuild test tree with proper project scoping
777+ - No data migration needed - discovery rebuilds from scratch
778+
779+ This design ensures zero functional degradation for users without the new extension, while providing an instant upgrade path when they adopt it.
780+ ```
781+
754782---
755783
756784### 5. Project Discovery Triggers
0 commit comments