Closed mtilda closed 5 months ago
I'm guessing that you posted the issue in the wrong places: It seams more a rust-analyzer issue instead. There's nothing we can do for fix it: from our point of view everything work well:
mdamico@miklap:~/dev_random/rstest_262$ cargo test
Compiling rstest_262 v0.1.0 (/home/mdamico/dev_random/rstest_262)
Finished `test` profile [unoptimized + debuginfo] target(s) in 0.20s
Running unittests src/main.rs (target/debug/deps/rstest_262-1caee84ec4ffcd71)
running 3 tests
test tests::test_a ... ok
test tests::test_b ... ok
test tests::test_c ... ok
test result: ok. 3 passed; 0 failed; 0 ignored; 0 measured; 0 filtered out; finished in 0.00s
@la10736 thanks for the quick reply!
Yesterday, per your suggestion, I opened https://github.com/rust-lang/rust-analyzer/issues/17458
Now fixed by: https://github.com/rust-lang/rust-analyzer/pull/17462
Background
I am using the crates rstest and serial_test.
VS Code's IntelliSense stops working when I define a test function with both
#[rstest]
and#[serial]
.IntelliSense is a VS Code feature (or rather a collection of features) that provide suggestions, information about symbols, and navigational tools.
The VS Code extension rust-analyzer provides support for the Rust language.
The root cause of this problem could be any one of the above mentioned technologies. Let me know if you think this issue does not belong on this repository.
Steps to reproduce
Install VS Code (I am on version 1.90.1)
Install the extension rust-analyzer (I am on version v0.3.2002)
Install Rust (I am on 1.78.0)
Use the command
cargo init
to create a new cargo package.Add the necessary dependencies with the command
cargo add rstest serial_test
; or if you want the same versions as me, use the commandcargo add rstest@0.21.0 serial_test@3.1.1
Open VS Code
Paste this in
src/main.rs
:Create
src/tests.rs
with the following content:Expected behavior
_example
and=
, We should expect to see the inferred typeVec<i32>
._example
in each test function. We should expect to see a Peek..
aftervec![1,2,3]
and before the;
. We should expect to see a drop down of suggestions (see screenshots).Screenshots