Skip to content
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

Wrong default directory with workspace #94

Open
martinellison opened this issue Nov 21, 2019 · 1 comment
Open

Wrong default directory with workspace #94

martinellison opened this issue Nov 21, 2019 · 1 comment

Comments

@martinellison
Copy link

martinellison commented Nov 21, 2019

If I click on the file location of an error, it should take me to the location of the error, but instead it opens up a file search dialog. This is because the "default directory" is wrong.

My project has a workspace which is probably triggering the problem. I've checked the code and it seems to be looking up the file tree until it finds a Cargo.toml, and then it uses this directory as the "default directory". Unfortunately, because my subdirectory (containing the workspace member) also has a Cargo.toml, it is stopping too early and using the workspace member directory as the "default directory" when it should be using the parent (top level, whole workspace) directory as the "default directory".

This might be the same as errors #31 and #56, but those have been closed and I am getting this error.

@TakaakiFuruse
Copy link

@kwrooijen

I am experiencing kinda same issue.

I have created a test project for reproducing the bug.
https://github.com/TakaakiFuruse/workspace_test

The project has a sub-crate. On top of the project directory, I have defined workspace option.

[workspace]
members = ["workspace_one"]

Reproduction

  1. Clone it to your PC.
  2. Open workspace_test/workspace_one/main.rs
  3. Move the cursor to fn test_workspace
  4. Execute cargo-process-current-test

What will happen

The test should fail but, nothing happens, since the command runs 0 tests.

Here's the output from console

-*- mode: cargo-process; default-directory: "~/workspace_test/" -*-
Cargo-Process started at Tue Dec 24 16:03:59

/home/xxx/.cargo/bin/cargo test -- --nocapture tests::test_workspace  
warning: unused import: `super::*`
 --> src/main.rs:7:9
  |
7 |     use super::*;
  |         ^^^^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

    Finished test [unoptimized + debuginfo] target(s) in 0.00s
     Running target/debug/deps/workspace_test-c2d13f97c3dc0ca1

running 0 tests

test result: ok. 0 passed; 0 failed; 0 ignored; 0 measured; 1 filtered out


Cargo-Process finished at Tue Dec 24 16:03:59

In this case, default-directory should be ~/workspace_test/workspace_one to run the test.

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

No branches or pull requests

2 participants