Repository navigation
feat(debug): targetBindings.cwd 可以绑到 target.directory - #56
Merged
Merged
Conversation
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.
背景
#55 合入时用的是 671cdc6,后来推到同一分支的 268d9a2(
targetBindings.cwd←target.directory)没有进 main。本 PR 把它 cherry-pick 到最新 main 重新提交。调试引擎
perform_launch(rust/crates/debug/src/engine.rs)在 launch 参数缺cwd时把cwd填成工作区根目录。所以即使有了 #55 的dlvCwd和env.PWD,Delve 能在包目录编译,被调程序仍在工作区根目录运行,按包目录写的相对路径(例如examples/greeting.txt)读不到。Go 插件 e2e 的多模块工作区用例就因此 panic。改动
validate_configuration.rs:targetBindings.cwd的允许值从只有target.workingDirectory扩到target.workingDirectory或target.directory,其他值报cwd can only be bound to target.workingDirectory or target.directory.。plan.rs:cwd和adapterArguments共用一段事实检查。缺工作目录时报target.workingDirectory;路径是裸文件名、取不出目录时报target.path。start.rs:cwd绑定改用path_fact()取值。declaration.rs、rust/contracts/rust-core-api.md:文档注释与 Core API 说明。plugin-manifest.schema.json:targetBindings.cwd从const改为两个值的枚举。contract/v1/README.md、guides/debug-adapter-plugin.md、reference/domains/debug-adapters.md(中英):写明cwd←target.directory,以及调试引擎在缺cwd时用工作区根目录。fixtures/debug-adapters/debug-adapter-rejections.json:新增cwd-from-target-path。reference/protocol-changelog.md:2026-11-15 新增 feat(debug): targetBindings.cwd 可以绑到 target.directory #56 一行(API-30,debugAdapters0 内的补充)。rust/crates/core/src/tests/declarative_plugins.rs):debug_start_arguments_bind_cwd_to_the_directory_of_the_target:cwd←target.directory取源文件所在目录,cwd←target.workingDirectory不变,裸文件名路径和缺工作目录分别被拒绝。debug_start_arguments_fill_adapter_arguments_from_path_facts同时绑cwd←target.directory。关联
cwd那句话放在哪一行,代码、契约和 fixture 完全相同,但它不在 Core main 上。本 PR 合入后,桌面端要把固定版本改到合入后的 commit。在那之前,请不要删除feat/debug-adapter-named-arguments分支。"cwd": "target.directory"(fix(debug): Delve 在当前文件所在的包目录构建、调试和运行 lithe-plugin-go#10)。Go Support 1.0.0 等本 PR 合入后再重发。验证
cargo fmt --all -- --checkcargo clippy --locked -p lithe-debug -p lithe-core --all-targets --all-features -- -D warningscargo test --locked -p lithe-debug -p lithe-core -p lithe-plugin-model:lithe-core 810 个测试全部通过。scripts/rust-core/verify-rust-core-comments.sh debug corenode shared/plugins/scripts/verify-docs.mjsnode scripts/rust-core/verify-platform-tests.mjs和 Windows 目标 clippy,都通过。