Intellij-rust: Code completion does not work for reqwest crate - "File is not included in module tree, analysis is not available" - Reproducible

Created on 23 Nov 2019  路  3Comments  路  Source: intellij-rust/intellij-rust

Environment

  • IntelliJ Rust plugin version:
    0.2.110.2150-192
  • Rust toolchain version:
    1.39.0
  • IDE name and version:
    Clion 2019.2.5
  • Operating system:
    Windows 10 Version 1909

Problem description

Should be easy to reproduce.

Code completion for reqwest does not work when using reqwest = "0.10.0-alpha.2" under [dependencies] in Cargo.toml (the latest version of reqwest).

Whats interesting is that it doesn't work for version "0.10.0-alpha.1" either, but it does work for "0.9.22" (the last 0.9 release). Unfortunately I can't use 0.9.22 as there are breaking changes in 0.10+

Demo

Note in the above GIF at the start (where the cursor is). new() in ClientBuilder::new() isn't blue.

Steps to reproduce

Create a new Rust project in CLion, and

Cargo.toml add these dependencies:

...
[dependencies]
reqwest = "0.10.0-alpha.2"
tokio = "0.2.0-alpha.6"

in main.rs have something like:

use reqwest::ClientBuilder;

#[tokio::main]
pub async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = ClientBuilder::new()
        .http2_prior_knowledge()
...
bug duplicate macros type inference & name resolution

All 3 comments

Seems to be the same issue described in https://github.com/intellij-rust/intellij-rust/issues/4627#

@YenForYang thanks for the report!
The reason is module declaration is generated by macro call.
Try to enable experimental macro expansion engine (see #3628). It should solve your issue

Seems to be the same issue described in #4627

The global reason is the same, yes. But in this case experimental engine can process it but in case of #4627 - not yet because mod declaration is under several macro calls that is not supported yet

It's fixed in #4914 and will be landed in the next release (I hope).
I close this issue as a duplicate of #4627 because they have the same reason

Was this page helpful?
0 / 5 - 0 ratings

Related issues

joslopgar picture joslopgar  路  3Comments

HybridEidolon picture HybridEidolon  路  4Comments

evanjpw picture evanjpw  路  3Comments

NamsooCho picture NamsooCho  路  3Comments

itmuckel picture itmuckel  路  3Comments