-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
to_abs_ws_path
goes too far up
#33
Comments
Relevant code: Lines 644 to 668 in 21f04f3
|
A clean fix for that would require rust-lang/cargo#3946 to be tackled, but the workaround suggested in rust-lang/cargo#3946 (comment) doesn't seem terrible to me: $ pwd
/home/amos/bearcove/rust/src/tools/rust-analyzer/crates/ide/src/syntax_highlighting
$ cargo locate-project --workspace --message-format plain
/home/amos/bearcove/rust/src/tools/rust-analyzer/Cargo.toml |
Running cargo from a |
An alternative fix for our specific situation would be to simply set an environment variable (maybe named |
That would also be a nice alternative, assuming the people responsible for |
As another alternative, this hack doesn't involve calling out to cargo: rust-lang/cargo#3946 (comment) The idea would be to create a [env]
CARGO_WORKSPACE_DIR = { value = "", relative = true } Then the env var would be set when running edit: This would still involve changes to |
Yeah, I like that a bit more than changing x.py since it will also work when you just run |
Sounds good, I'll open an |
... or we could merge #30, I guess? 🤔 |
|
Mhh I don't love the adhoc-toml-parsing there, it'll fail for (admittedly fringe) cases like this: workspace = { members = [
"xtask/",
"lib/*",
"crates/*",
], exclude = [
"crates/proc-macro-test/imp",
] } |
I'd like that PR more if it brought a real TOML parser with it but now that's overkill, and that energy is better spent pushing for the cargo bug to be fixed instead imho. |
That's true. I'm fine with either (or both). |
I think I prefer the |
This adds support for testing `rust-analyzer` in-tree. Test rust-analyzer in CI Set CARGO_WORKSPACE_DIR directly in `prepare_tool_cargo` cf. rust-lang#99444 (comment) cf. rust-analyzer/expect-test#33 Various x.py changes for Submodule => InTree, and removing toolstate Introduce `rust-analyzer/in-rust-tree` cargo feature This allows skipping ra's "check_merge_commits" test for now. Later, it might be used to link against `extern proc_macro` directly, cf. rust-lang/rust-analyzer#12803 More cleanups around the RustAnalyzer tool in bootstrap Start fixing lints Deny the same warnings x.py does in all RA crates Warn on x.py warnings, don't deny cf. https://rust-lang.zulipchat.com/#narrow/stream/185405-t-compiler.2Frust-analyzer/topic/rust-analyzer.20as.20a.20subtree.3A.20experimental.20PR.20status/near/290114101 Fix rust_2018_idioms with cargo fix Add warning groups for more RA crates Fix more 2015 idioms (with 2018_idioms, naming is fun) RA passes all x.py warnings Fix formatting after fixing idioms/additional warnings Enable in-rust-tree feature, RA tests pass Print stdout+stderr when nested cargo invocation fails
Running RA tests from within a
rust-lang/rust
checkout fails, becauseexpect-test
climbs all the way up torust/Cargo.toml
instead of being happy withrust/src/tools/rust-analyzer/Cargo.toml
, and then the paths are all wrong.See rust-lang/rust#99444 (comment) for real-world details.
The text was updated successfully, but these errors were encountered: