Skip to content

Commit b9dfe55

Browse files
committed
fix(settings): 将 Python 解释器覆盖移至语言与框架
1 parent 237f81b commit b9dfe55

3 files changed

Lines changed: 11 additions & 2 deletions

File tree

‎docs/feature-matrix.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212

1313
| 能力域 | 功能项 | `darwin-arm64` | `darwin-x64` | `windows-x64` / `windows-arm64` | `linux-x64` / `linux-arm64` | 最近实机验证 | 实现与测试证据路径(本仓库) |
1414
| --- | --- | --- | --- | --- | --- | --- | --- |
15+
| Python 解释器覆盖设置 | 在「设置 → 语言与框架 → Python」显示用于构建、运行和 pytest 的解释器覆盖路径。已保存的覆盖值继续按 `pythonExecutable` 读取。 | ✅ Core 设置目录与保存值回读通过 | ⏳ 平台清单已验证 | ⏳ 平台清单已验证 | ⏳ 平台清单已验证 | `2026-11-22`(`darwin-arm64`,桌面 0.8.13 固定 Core) | `io.github.lithe-idea.python-support/plugin.json`<br>`scripts/package/archives.test.mjs` |
1516
| 语言基础 (`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`<br>`scripts/test.mjs`<br>`e2e/host/desktop/internal/workbench/python_support_plugin_e2e_test.go`<br>`e2e/host/desktop/internal/workbench/python_shebang_e2e_test.go` |
1617
| 无后缀 Python 脚本 | 支持 TextMate 首行匹配的桌面按解释器路径或 `env` shebang 打开,提供 Python 高亮、注释与 Pyrefly 诊断 | ✅ 已验证 | ⏳ 待实机验证 | ⏳ 待实机验证 | ⏳ 待实机验证 | `2026-11-20`(`darwin-arm64`,桌面 `645a3aee8`) | `io.github.lithe-idea.python-support/grammars/python.first-line.json`<br>`scripts/test.mjs`<br>`e2e/host/desktop/internal/workbench/python_shebang_e2e_test.go` |
1718
| 插件后端与语言服务器启动解析 (`backend` + `languageServers`) | 包内 Rust SDK 后端协商 `litheLogging` 0 与 `litheFunctions` 0。解析 `pyrefly lsp` 启动,传入宿主提供的解释器,缺失时使用 Pyrefly 原生检测。 | ✅ 已验证(桌面主线) | ⏳ 归档已校验 | ⏳ 待 CI 与宿主验收 | ⏳ 待 CI 与宿主验收 | 2026-11-20(macOS ARM64,桌面主线) | `backend/src/pyrefly.rs`<br>`scripts/test.mjs`<br>`e2e/host/desktop/internal/workbench/python_support_plugin_e2e_test.go`<br>`e2e/host/desktop/internal/workbench/python_editor_debug_e2e_test.go` |

‎io.github.lithe-idea.python-support/plugin.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@
100100
"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).",
101101
"default": "",
102102
"effect": "reload",
103-
"page": { "buildSystemID": "python" },
103+
"page": { "languageID": "python" },
104104
"section": "Python Interpreter"
105105
},
106106
{

‎scripts/package/archives.test.mjs‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,20 @@ import { existsSync, readdirSync, readFileSync } from "node:fs";
55
import { resolve } from "node:path";
66
import { readZipEntries } from "../lib/archive.mjs";
77
import { backendPath } from "../lib/backend.mjs";
8-
import { ASSET_PREFIX, PACKAGE_ID } from "../package.mjs";
8+
import { ASSET_PREFIX, manifestForPlatform, PACKAGE_ID } from "../package.mjs";
99

1010
const baseManifest = JSON.parse(readFileSync(`${PACKAGE_ID}/plugin.json`, "utf8"));
1111
const lock = JSON.parse(readFileSync("vendor-lock.json", "utf8"));
1212
const version = baseManifest.version;
1313

14+
test("the Python interpreter override is on the Python language page on every platform", () => {
15+
for (const platform of Object.keys(lock.pyrefly.platforms)) {
16+
const manifest = manifestForPlatform(baseManifest, platform, lock);
17+
const interpreter = manifest.settings.find(({ id }) => id === "pythonExecutable");
18+
assert.deepEqual(interpreter?.page, { languageID: "python" }, platform);
19+
}
20+
});
21+
1422
function checkBackendArchitecture(bytes, platform) {
1523
const arm = platform.endsWith("-arm64");
1624
if (platform.startsWith("windows-")) {

0 commit comments

Comments
 (0)