Closed
Description
So I just ran into this issue with types implemented in the standard library.
Here are my repro steps:
- Inside
src/main.rs
include the following:
use std::sync::Mutex;
fn main() {
let m = Mutex::new(0);
}
- Place your cursor (
|
) inMutex::ne|w
and trigger "Go to definition" (A.K.A. F12). - VS Code will display the code lens option to "Run Doctest" in the library's definition:
Now, here are some thoughts. Note that I'm a Rust beginner (I encountered this while going though the Rust book hehe) so please take it with a grain of salt <3.
- I don't think that code lens inside code that I didn't write myself should be enabled at all, since those feel like "implementor/dev-only" tools, and I don't immediately see why the clients of the APIs would need them. So I wouldn't be upset if this feature is removed (it's not working anyway...).
- From the picture included in point 4 above, it seems like
cargo test
is running inside my current workspace, and not where the code lens is being displayed.
Originally posted by @MariaSolOs in #8248 (comment)