You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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 command cargo add [email protected][email protected]
Open VS Code
Paste this in src/main.rs:
mod tests;fnmain(){println!("Hello, world!");}
Create src/tests.rs with the following content:
#[cfg(test)]mod tests {use rstest::rstest;use serial_test::serial;#[rstest]fntest_a(){// IntelliSense works herelet _example = vec![1,2,3];}#[test]#[serial]fntest_b(){// IntelliSense works herelet _example = vec![1,2,3];}#[rstest]#[serial]fntest_c(){// IntelliSense does not work herelet _example = vec![1,2,3];}}
Expected behavior
Between _example and =, We should expect to see the inferred type Vec<i32>.
Hover your mouse over the _example in each test function. We should expect to see a Peek.
Type a . after vec![1,2,3] and before the ;. We should expect to see a drop down of suggestions (see screenshots).
Screenshots
The text was updated successfully, but these errors were encountered:
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 [email protected] [email protected]
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
The text was updated successfully, but these errors were encountered: