Skip to content

fix(core): Git 认证错误码、补全触发字符、选区格式化与启动计划 golden - #4

Merged
1lck merged 3 commits into
mainfrom
feat/1799-core-root-fixes
Nov 10, 2026
Merged

1lck merged 3 commits into
mainfrom
feat/1799-core-root-fixes

Conversation

@1lck

@1lck 1lck commented Nov 10, 2026

Copy link
Copy Markdown
Contributor

Viva 客户端(1lck/Lithe-IDEA#1799)之前在 Go 里临时绕过了几处 Core 缺口。这个 PR 在 Core 里把它们修掉,同时修复 main 上两个失败的 golden 测试。

改动

  • Git 认证失败错误码
    • git.write 认证失败时,operationError.code 返回 git_authentication_failed。
    • Core 运行 Git 时已固定 LC_ALL=C 和 GIT_TERMINAL_PROMPT=0,所以判断结果不受系统语言影响。
    • 覆盖的情况:HTTP 401/403、没有凭据、GitHub 拒绝推送、SSH publickey 被拒。
    • 已有的更具体错误码保持不变,不会被这个新错误码替换。
    • 新增模块 git/authentication_failure.rs 和 fixture shared/fixtures/git/authentication-failure-v1.json,并在 rust-core-api.md 写明。
  • 补全触发字符
    • featuresChanged 事件新增 completionOptions: {triggerCharacters, allCommitCharacters}。
    • 取值是服务器初始化时声明的 completionProvider 加上动态注册的合集;动态注册变化后会重新发送。
    • isIncomplete 原本就会保留,这次补了回归测试。
  • 格式化
    • 新增语义操作 rangeFormatting。
    • formatting 和 rangeFormatting 都可以传 formattingOptions,包括 tabSize(1–1024)以及 insertSpaces 等布尔值。传了就覆盖原来的默认值,不传时行为不变。
  • 契约 golden
    • 从 feat(core): 补齐工具链编辑、Debug 时序与插件设置文档 #3 起,languageServerLaunchPlan 会返回 owner,即 Core 校验过的插件包身份。
    • 但 command-plans.json、language-server-launch-resolution.json 和契约 README 没有同步更新,导致 command_plan_fixtures_match_golden_expansions 和 launch_resolution_cases_match_the_contract_golden 两个测试失败。
    • 这次在 fixture 里补上 owner,并加进 README 的字段表。

以上都是增量兼容的改动:只新增字段、错误码和操作,原有的调用方式和默认值不变。插件公开协议(plugin_function.rs)没有修改。

验证

  • cargo test -p lithe-core --no-fail-fast:1772 项通过
  • cargo fmt --all --check、scripts/rust-core/verify-rust-core-comments.sh 通过
  • Viva 客户端用本分支作为 override 构建,./internal/core/... 和 ./internal/workbench/... 测试通过

合并后

  • 把契约目录同步到 1lck/Lithe-IDEA 的 shared/contracts/plugins/v1/ 和 lithe-plugin-docs。
  • 客户端更新 Core pin,删掉 Go 里匹配英文 stderr 和写死触发字符的临时代码,并把编辑器的缩进设置传给格式化。

🤖 Generated with Claude Code

1lck and others added 3 commits November 9, 2026 23:27
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- featuresChanged 新增 completionOptions(triggerCharacters/allCommitCharacters)
- 新增 rangeFormatting 操作与 rangeFormatting 能力
- formatting 接受 formattingOptions,缺省保持原默认值

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Core #3 起 languageServerLaunchPlan 返回 Core 校验过的包身份 owner,
但 command-plans.json、language-server-launch-resolution.json 和 README 未同步,
导致 main 上两个 golden 测试失败。现在 lithe-core 全量 1772 项通过。

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@1lck
1lck merged commit 9eccfd6 into main Nov 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant