Repository navigation
Fall back when Python environments API is incomplete - #81
sama Pyb (Pybsama) wants to merge 1 commit into
Conversation
|
Revalidated this change against current The runtime case remains relevant: current Current-main validation:
The upstream run now has 19 successful checks, including Linux/Windows Python 3.10–3.14, TypeScript, both CodeQL analyses, version checks, and CLA. The only failure is The public head remains the original GitHub-verified commit because GitHub reports the PR as mergeable and the current-main changes do not overlap the patch. Marking this ready for maintainer review. |
There was a problem hiding this comment.
🟢 Approval recommended
The implementation addresses the reported failure with focused, comprehensive tests and no unresolved issues.
Pull request overview
Adds robust fallback behavior when the preferred Python Environments API is unavailable or incomplete.
Changes:
- Validates required API capabilities before caching.
- Falls back to the legacy Python API.
- Treats package-change events as optional with a no-op disposable.
File summaries
| File | Description |
|---|---|
typescript/src/python.ts |
Implements API validation, fallback, and optional package events. |
typescript/tests/python.test.ts |
Tests fallback, caching, and missing optional events. |
Review details
- Files reviewed: 2/2 changed files
- Comments generated: 0
- Review effort level: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
sama Pyb (@Pybsama) |
Summary
undefinedor incomplete exportsonDidChangePackagesoptional and provide a no-op disposable when that non-critical event is unavailableContext
When the Python Environments integration is disabled, the installed extension can return
undefinedexports without throwing. The shared provider previously cached that result and later failed while subscribing to environment/package events instead of trying its existing legacy fallback.This change belongs in the shared package consumed by Pylint and the other VS Code Python tool extensions. It does not bump the package version or update downstream submodules; the existing release workflow owns those steps after merge.
Addresses microsoft/vscode-pylint#856.
Testing