Skip to content

Custom proc macro for test functions no longer provide "Run Test" codelens #11396

@Veetaha

Description

@Veetaha

This regression has been there for quite some time, but I decided to report it only today, sorry...
I remember that at some point this worked and rust-analyzer showed codelens on top of a proc macro attribute that contains test in its signature.

E.g. the following code showed this codelens:
image

just like it shows it when I switch the proc macro to tokio::test
image

I even remember reviewing a PR that initially added a heuristic that searches for a substring "test" in the proc macro name to gate the addition of that codelens, but that was a long time ago and I assume this heuristic either gone broken or was changed [un]intentionally.

I suggest we fix this and return that codelens back.

Meta

rust-analyzer version:

rust-analyzer version: 34138379b 2022-02-02 nightly

rustc version:

$ rustc --version --verbose
rustc 1.58.0 (02072b482 2022-01-11)
binary: rustc
commit-hash: 02072b482a8b5357f7fb5e5637444ae30e423c40
commit-date: 2022-01-11
host: x86_64-unknown-linux-gnu
release: 1.58.0
LLVM version: 13.0.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-idegeneral IDE featuresC-bugCategory: bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions