fix(maker): install lua lsp in private venv#250
Merged
Conversation
- Create a Maker-owned lua-lsp-venv before installing maker-lua-lsp. - Run pip install through the venv Python instead of uv-managed Python. - Resolve externally-managed-environment failures on uv Python 3.12. - Keep LSP setup best-effort and expose setup errors without blocking builds. - Update CLI/runtime tests and Maker docs for the venv installation flow. - Verified Jest Maker tests, format check, lint, and Maker build.
|
| Filename | Overview |
|---|---|
| src/maker/system/luaLsp.ts | 核心变更:新增 ensureLuaLspVenv / isLuaLspVenvComplete / getLuaLspVenv* 辅助函数将 LSP 安装隔离到私有 venv;checkMakerLuaLspEnvironment 添加 saved.command 快速路径;readLuaLspVersion 新增 --help fallback 及 5 s 超时;整体逻辑正确,存在 saved.command 与 venv command 路径相同时的冗余版本探测问题。 |
| src/tests/makerLuaLspRuntime.test.ts | 新增两个测试:(1) venv 不完整时触发重建;(2) 仅支持 --help 的 LSP 被 doctor 正确识别;现有测试用例同步更新 venv 路径和 mock 行为,覆盖完整。 |
| src/tests/makerCliCommands.test.ts | 两个测试用例更新:mock 改为先触发 python -m venv,再用 venvPython 执行 pip install,断言也同步添加了 venv 创建步骤的 spawnSync 调用校验。 |
| docs/MAKER.md | lua-lsp setup 和 python setup 的描述更新为引用私有 LSP venv,文档与代码行为一致。 |
| docs/MAKER_PYTHON_RUNTIME_WINDOWS_TEST.md | 更新 Windows 测试文档,添加 lua-lsp-venv 创建步骤及预期输出,与新流程一致。 |
| AGENTS.md | 单行更新,将直接安装/升级改为创建 Maker 私有 LSP venv 并在其中安装/升级,与实现保持一致。 |
| docs/MAKER_CLI_MCP_SKILL_REWORK_OVERVIEW.md | 更新 CLI 命令描述以反映 venv 隔离策略,无遗漏。 |
| skills/taptap-maker-local/SKILL.md | Skill 说明更新,指出 setup 先创建私有 LSP venv 再安装,英文表述准确。 |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[setupMakerLuaLspEnvironment] --> B{Python ready?}
B -- No --> Z1[返回 python_missing]
B -- Yes --> C[ensureLuaLspVenv]
C --> D{isLuaLspVenvComplete?\nvenvPython + pyvenv.cfg 均存在}
D -- Yes --> E
D -- No --> F[python -m venv lua-lsp-venv\ntimeout=120s]
F --> G{status=0?}
G -- No --> Z2[返回 setup_failed]
G -- Yes --> E
E[venv.python pip install maker-lua-lsp\ntimeout=120s] --> H{status=0?}
H -- No --> Z3[返回 setup_failed]
H -- Yes --> I[resolveLuaLspCommand\n优先检查 venv command]
I --> J[maker-lua-lsp install --ide\ntimeout=120s]
J --> K{status=0?}
K -- No --> Z4[返回 setup_failed]
K -- Yes --> L[readLuaLspVersion\n--version / --help fallback\ntimeout=5s]
L --> M[saveLuaLspRuntimeConfig status=ready]
M --> N[返回 changed=true]
subgraph checkMakerLuaLspEnvironment
P[加载 lua-lsp.json] --> Q{saved.command?}
Q -- Yes --> R[readLuaLspVersion timeout=5s]
R --> S{version?}
S -- Yes --> T[返回 ready 快速路径]
S -- No --> U[resolveLuaLspCommand]
Q -- No --> U
U --> V[readLuaLspVersion timeout=5s]
V --> W{version?}
W -- Yes --> T2[返回 ready]
W -- No --> X{setup_failed?}
X -- Yes --> Y[返回 setup_failed]
X -- No --> Z[返回 missing]
end
Reviews (2): Last reviewed commit: "fix(maker): harden lua lsp venv recovery" | Re-trigger Greptile
- Recreate the Maker Lua LSP venv when pyvenv.cfg is missing. - Keep interrupted venv creation from causing repeated setup failures. - Add short timeouts to maker-lua-lsp version and help probes. - Cover corrupted venv recovery and probe timeout behavior with tests. - Verified Maker Jest tests, format check, lint, and Maker build.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
背景
改动内容
验证