Repository navigation
Auto Find: exclude markers inside each workspace folder's selected environment sysPrefix - #1843
Conversation
…ry (#406) Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
sysPrefix
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The implementation matches the stated scope and includes appropriate cross-platform tests and failure handling.
Review effort: Balanced
Findings: None
What changed in this PR
Excludes project markers located inside selected workspace environments, preventing installed packages from appearing as projects.
Changes:
- Filters markers using each selected environment’s absolute
sysPrefix. - Continues discovery when environment lookup fails.
- Adds cross-platform unit coverage and dependency wiring.
| File | Description |
|---|---|
src/features/creators/autoFindProjects.ts |
Adds environment-prefix filtering. |
src/extension.ts |
Injects environment managers. |
src/test/features/creators/autoFindProjects.unit.test.ts |
Tests filtering and fallback behavior. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Eleanor Boyd (eleanorjboyd)
left a comment
There was a problem hiding this comment.
The filter assumes everything beneath an environment’s sysPrefix is an environment artifact. For system Python with sysPrefix = /usr, a legitimate workspace at /usr/src/app loses every project marker.
Copilot address the issue of potential false positives, maybe get the environment object and extract metadata from there first? |
Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
cfaa1ec
Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
Addressed in |
Co-authored-by: edvilme <5952839+edvilme@users.noreply.github.com>
|
🔒 Automated review in progress — Rich Chiodo (@rchiodo) is auto-reviewing this PR. |
| (folder) => | ||
| isSameOrParentPath(prefix, folder.uri.fsPath) && | ||
| isSameOrParentPath(folder.uri.fsPath, uri.fsPath), | ||
| ), |
There was a problem hiding this comment.
Warning · Non-blocking recommendation
When a workspace folder equals its selected environment prefix, this exception preserves every marker below it, including site-packages/pkg/setup.py. Apply the broad exception only when the workspace is strictly below the prefix; for equality, preserve only a marker at the workspace root, and add a test covering a nested installed package.
|
Result: 🔴 Verification detailsVerification: The relevant tests could not be fully run in the isolated environment; this review is not fully verified. Summary: [unavailable] Container verification could not start and local execution was not authorized for this PR HEAD: Podman machine 'pyrx-automation' is not running. Test runs: none recorded. |
Rich Chiodo (rchiodo)
left a comment
There was a problem hiding this comment.
Approved via Review Center.
664656d
into
main

Fixes #406
Auto Find searches for
pyproject.tomlandsetup.pybut excludes only**/.venv/**. As a result, packages installed in a selected environment with any other directory name (for examplecustom-env/lib/.../site-packages/pkg/setup.py) are offered as projects. This PR drops those false positives using thesysPrefixof the environment selected for each workspace folder.Changes
AutoFindProjects(src/features/creators/autoFindProjects.ts)EnvironmentManagersas a new constructor dependency.findFilesreturns results, callsenvManagers.getEnvironment(folder.uri)once for each folder ingetWorkspaceFolders(). Only non-empty, absolutesysPrefixvalues are kept.isSameOrParentPath, which already enforces path boundaries and handles Windows case and separators.traceWarnand that folder is skipped; discovery continues.src/extension.ts): passes the existingenvManagersinstance toAutoFindProjects.Unchanged
**/.venv/**exclusion, picker, de-duplication and registration.Out of scope
An environment that is not the selected one for any workspace folder is still excluded only if it is named
.venv.Tests (
autoFindProjects.unit.test.ts)custom-envselected environment excludes both marker types, including a marker at the environment root. A real project next to it and a similarly named siblingcustom-env-projectare still offered.undefinedprefix, a relative prefix and a thrown lookup each leave existing behaviour unchanged.