From 196b45c7297b0350a9bde92a290fa03d199f0d3f Mon Sep 17 00:00:00 2001 From: Hung-I Wang Date: Sat, 2 Nov 2019 23:42:54 +0800 Subject: [PATCH 1/2] Pass file directory as cwd for Run test of CodeLens --- rls/src/actions/run.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/rls/src/actions/run.rs b/rls/src/actions/run.rs index 1706b0aeb2d..80c428adc39 100644 --- a/rls/src/actions/run.rs +++ b/rls/src/actions/run.rs @@ -67,6 +67,7 @@ pub fn collect_run_actions(ctx: &InitActionContext, file: &Path) -> Vec, pub env: HashMap, + pub cwd: Option, } pub struct LineIndex { From 3138d878cfa3edbddd202f21d72033eda0d9287e Mon Sep 17 00:00:00 2001 From: Hung-I Wang Date: Sun, 3 Nov 2019 00:55:41 +0800 Subject: [PATCH 2/2] Update the test client_lens_run accordingly --- tests/client.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/client.rs b/tests/client.rs index 7e2e7be07c3..a569c41738d 100644 --- a/tests/client.rs +++ b/tests/client.rs @@ -987,7 +987,8 @@ fn client_lens_run() { arguments: Some(vec![json!({ "args": [ "test", "--", "--nocapture", "test_foo" ], "binary": "cargo", - "env": { "RUST_BACKTRACE": "short" } + "env": { "RUST_BACKTRACE": "short" }, + "cwd": p.root().join("src") })]), }), data: None,