From b9dfe554fe88d42ccf5d4be31c9ccd830beb5c09 Mon Sep 17 00:00:00 2001 From: Mucheen <1528136628@qq.com> Date: Sun, 22 Nov 2026 10:30:40 +0800 Subject: [PATCH] =?UTF-8?q?fix(settings):=20=E5=B0=86=20Python=20=E8=A7=A3?= =?UTF-8?q?=E9=87=8A=E5=99=A8=E8=A6=86=E7=9B=96=E7=A7=BB=E8=87=B3=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E4=B8=8E=E6=A1=86=E6=9E=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/feature-matrix.md | 1 + io.github.lithe-idea.python-support/plugin.json | 2 +- scripts/package/archives.test.mjs | 10 +++++++++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docs/feature-matrix.md b/docs/feature-matrix.md index 9f9742d..ee3f910 100644 --- a/docs/feature-matrix.md +++ b/docs/feature-matrix.md @@ -12,6 +12,7 @@ | 能力域 | 功能项 | `darwin-arm64` | `darwin-x64` | `windows-x64` / `windows-arm64` | `linux-x64` / `linux-arm64` | 最近实机验证 | 实现与测试证据路径(本仓库) | | --- | --- | --- | --- | --- | --- | --- | --- | +| Python 解释器覆盖设置 | 在「设置 → 语言与框架 → Python」显示用于构建、运行和 pytest 的解释器覆盖路径。已保存的覆盖值继续按 `pythonExecutable` 读取。 | ✅ Core 设置目录与保存值回读通过 | ⏳ 平台清单已验证 | ⏳ 平台清单已验证 | ⏳ 平台清单已验证 | `2026-11-22`(`darwin-arm64`,桌面 0.8.13 固定 Core) | `io.github.lithe-idea.python-support/plugin.json`
`scripts/package/archives.test.mjs` | | 语言基础 (`languages`) | `.py` / `.pyi` / `.pyw` 识别、`#` 行注释、括号/引号配对、项目标记与 `.venv` / `venv` / `.conda` 依赖目录 | ✅ 已验证 | ⏳ pending(归档与清单已校验) | ⏳ pending(归档与 Windows 清单已校验) | ⏳ pending(归档与清单已校验) | `2026-11-20`(`darwin-arm64`,0.8.9 复验 `.py` 高亮) | `io.github.lithe-idea.python-support/plugin.json`
`scripts/test.mjs`
`e2e/host/desktop/internal/workbench/python_support_plugin_e2e_test.go`
`e2e/host/desktop/internal/workbench/python_shebang_e2e_test.go` | | 无后缀 Python 脚本 | 支持 TextMate 首行匹配的桌面按解释器路径或 `env` shebang 打开,提供 Python 高亮、注释与 Pyrefly 诊断 | ✅ 已验证 | ⏳ 待实机验证 | ⏳ 待实机验证 | ⏳ 待实机验证 | `2026-11-20`(`darwin-arm64`,桌面 `645a3aee8`) | `io.github.lithe-idea.python-support/grammars/python.first-line.json`
`scripts/test.mjs`
`e2e/host/desktop/internal/workbench/python_shebang_e2e_test.go` | | 插件后端与语言服务器启动解析 (`backend` + `languageServers`) | 包内 Rust SDK 后端协商 `litheLogging` 0 与 `litheFunctions` 0。解析 `pyrefly lsp` 启动,传入宿主提供的解释器,缺失时使用 Pyrefly 原生检测。 | ✅ 已验证(桌面主线) | ⏳ 归档已校验 | ⏳ 待 CI 与宿主验收 | ⏳ 待 CI 与宿主验收 | 2026-11-20(macOS ARM64,桌面主线) | `backend/src/pyrefly.rs`
`scripts/test.mjs`
`e2e/host/desktop/internal/workbench/python_support_plugin_e2e_test.go`
`e2e/host/desktop/internal/workbench/python_editor_debug_e2e_test.go` | diff --git a/io.github.lithe-idea.python-support/plugin.json b/io.github.lithe-idea.python-support/plugin.json index a0bf80b..a1002ea 100644 --- a/io.github.lithe-idea.python-support/plugin.json +++ b/io.github.lithe-idea.python-support/plugin.json @@ -100,7 +100,7 @@ "description": "Explicit path to the Python interpreter for build, run, and pytest commands. Leave empty to resolve automatically from the Python toolchain (.venv, venv, .conda, VIRTUAL_ENV, PATH, or discovered conda / uv / pyenv installations).", "default": "", "effect": "reload", - "page": { "buildSystemID": "python" }, + "page": { "languageID": "python" }, "section": "Python Interpreter" }, { diff --git a/scripts/package/archives.test.mjs b/scripts/package/archives.test.mjs index e4147a6..ee04bc3 100644 --- a/scripts/package/archives.test.mjs +++ b/scripts/package/archives.test.mjs @@ -5,12 +5,20 @@ import { existsSync, readdirSync, readFileSync } from "node:fs"; import { resolve } from "node:path"; import { readZipEntries } from "../lib/archive.mjs"; import { backendPath } from "../lib/backend.mjs"; -import { ASSET_PREFIX, PACKAGE_ID } from "../package.mjs"; +import { ASSET_PREFIX, manifestForPlatform, PACKAGE_ID } from "../package.mjs"; const baseManifest = JSON.parse(readFileSync(`${PACKAGE_ID}/plugin.json`, "utf8")); const lock = JSON.parse(readFileSync("vendor-lock.json", "utf8")); const version = baseManifest.version; +test("the Python interpreter override is on the Python language page on every platform", () => { + for (const platform of Object.keys(lock.pyrefly.platforms)) { + const manifest = manifestForPlatform(baseManifest, platform, lock); + const interpreter = manifest.settings.find(({ id }) => id === "pythonExecutable"); + assert.deepEqual(interpreter?.page, { languageID: "python" }, platform); + } +}); + function checkBackendArchitecture(bytes, platform) { const arm = platform.endsWith("-arm64"); if (platform.startsWith("windows-")) {