rust-lang / rust-lang/rust-analyzer

test-log crate breaks test runnables

Open
#12,396 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-ide C-bug
Dominant language
Rust
Stars
16.9k
Forks
2.2k
Avg merge
1d 12h
Merged PRs (30d)
72

Description

rust-analyzer version: rust-analyzer 5b69a34fb 2022-05-25 dev

rustc version: rustc 1.61.0 (fe5b13d68 2022-05-18)

relevant settings: Using emacs with lsp-mode.

The test-log crate (https://github.com/d-e-s-o/test-log) comes with a replacement test macro. You use it like this:

use test_log::test;

#[test]
fn my_test() {
  info!("I can see this now!");
}

But, with this use test_log::test, when I try to run the test using lsp-rust-analyzer-run it doesn't detect it as an option. If I remove the use, the test is runnable.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with rust-analyzer's runnable detection for the test-log use test_log::test case and reproduce it through lsp-rust-analyzer-run using the reported versions. Compare it with the same test without the import; done means the imported test is detected as runnable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
devtools, testing-qa
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.