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

No completion under #[tokio::test]? #10294

Closed
b8591340 opened this issue Sep 20, 2021 · 5 comments
Closed

No completion under #[tokio::test]? #10294

b8591340 opened this issue Sep 20, 2021 · 5 comments
Labels
A-macro macro expansion S-unactionable Issue requires feedback, design decisions or is blocked on other work

Comments

@b8591340
Copy link

I saw #6029 was closed, but I’m not getting type inference or completions in a #[tokio::test]-decorated function. This is VSC on nightly with 516eb40 stable.

@lnicola
Copy link
Member

lnicola commented Sep 21, 2021

Completion works now, but only if the macro is able to parse the function body.

Hmm, does tokio really need to use syn here?

@lnicola lnicola added A-macro macro expansion S-unactionable Issue requires feedback, design decisions or is blocked on other work labels Sep 21, 2021
@Veykril
Copy link
Member

Veykril commented Sep 21, 2021

They seem to parse the function body to get the span of the last statement for diagnostic purposes as well as inspecting the type of expression of the last statement.

@Veykril
Copy link
Member

Veykril commented Oct 11, 2021

Will be fixed by tokio-rs/tokio#4162

@lnicola
Copy link
Member

lnicola commented Oct 11, 2021

Does tokio::test actually care about the AST, or does it just splice its stuff around the function body?

@flodiebold
Copy link
Member

They do some shenanigans with the last statement/expression, though maybe that could be done by just looking for the last semicolon.

@Veykril Veykril closed this as completed Oct 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-macro macro expansion S-unactionable Issue requires feedback, design decisions or is blocked on other work
Projects
None yet
Development

No branches or pull requests

4 participants