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

Let Rust analyzer show the Run Test | Debug buttons for each test case #29

Open
t-moe opened this issue Apr 4, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@t-moe
Copy link
Contributor

t-moe commented Apr 4, 2024

This is related to rust-lang/rust-analyzer#17011 and can probably be fixed by emitting #[::core::prelude::v1::test] from my macros.

tokio test does this as well: https://github.com/tokio-rs/tokio/blob/a1acfd8c20475e8a878b012ac4aa90b361f004ae/tokio-macros/src/entry.rs#L365 )

Lets just hope that #[::core::prelude::v1::test] stays a no-op, when harness=false for that particular test.

@t-moe t-moe changed the title Rust analyzer does no longer show Run Test | Debug buttons Rust analyzer does no longer shows Run Test | Debug buttons Apr 4, 2024
@t-moe t-moe added the bug Something isn't working label Apr 4, 2024
@t-moe t-moe changed the title Rust analyzer does no longer shows Run Test | Debug buttons Rust analyzer no longer shows Run Test | Debug buttons Apr 4, 2024
@t-moe
Copy link
Contributor Author

t-moe commented Dec 3, 2024

Simply emitting #[::core::prelude::v1::test] before the test function does not seem to work.
Instead it looks like you have to manually convert the function into a token stream
https://github.com/tokio-rs/tokio/blob/master/tokio-macros/src/entry.rs#L589

couldnt get this to work in 30min. Not sure if needed. keeping this issue open until I get more user feedback

@t-moe t-moe added enhancement New feature or request and removed bug Something isn't working labels Dec 3, 2024
@t-moe t-moe changed the title Rust analyzer no longer shows Run Test | Debug buttons Let Rust analyzer show the Run Test | Debug buttons for each test case Dec 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant