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

Pass file directory as cwd for Run test of CodeLens #1584

wants to merge 2 commits into
base: master
Choose a base branch


Copy link

@Gowee Gowee commented Nov 2, 2019

In the previous implementation:

When there is a Cargo Workspace including several member packages, clicking CodeLens Run test button in source code files of a member package triggers shell execution cargo test -- --no-capture ... without specifying a current working directory.It appears that the default cwd is the Workspace / top-level package root (as expected).

Consequently, no targeted tests are actually perfomed as cargo test does not cover member packages unless --workspace is specified.

To fix the problem, there are two feasible ways:

  1. Adding --workspace option to cargo test.
  2. Setting the cwd properly.

The first way is much slower than the second as it takes more time to filter out unnecessary tests outside current member packages.

So this commit passes the file directory as Cmd.cwd in CodeLens Command to rls-vscode so that cargo test ... can be executed with proper cwd.

Copy link

@bors bors commented Jun 20, 2022

The latest upstream changes (presumably #1740) made this pull request unmergeable. Please resolve the merge conflicts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
None yet

Successfully merging this pull request may close these issues.

None yet

2 participants