rust-analyzer: Code completion not working in #[tokio::main]

rust-analyzer version: rust-analyzer version: 0.4.1232-standalone (476d04387 2022-10-04) rustc version: rustc 1.64.0 (a55dd71d5 2022-09-19) relevant settings:

Image showing that rust analyzer vs code setting Proc Macro is Enabled

I’m not getting code completion in #[tokio::main] but it seems based on old issues that it should work?

https://user-images.githubusercontent.com/1073892/194185072-9e26b8c1-0085-49e0-a0b1-0411795340c8.mov

This is happening in a fresh project with the following Cargo.toml:

[package]
name = "example"
version = "0.1.0"
edition = "2021"

[dependencies]
tokio = { version = "1.21.2", features = ["full"] }

Sorry if I should have resurrected an old issue instead of starting a new one.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 32 (31 by maintainers)

Most upvoted comments

With https://github.com/rust-lang/rust-analyzer/pull/13392, completions somewhat work in current tokio as well now, there are a few exceptions where it breaks due to https://github.com/rust-lang/rust-analyzer/issues/13388 still.